#[repr(C)]
union DiplomatResultValue<T, E> {
ok: ManuallyDrop<T>,
err: ManuallyDrop<E>,
}
/// A [`Result`]-like type that can be passed across the FFI boundary /// as a value. Used internally to return [`Result`]s and [`Option`]s /// from functions. #[repr(C)] pubstruct DiplomatResult<T, E> {
value: DiplomatResultValue<T, E>, pub is_ok: bool,
}
impl<T, E> Drop for DiplomatResult<T, E> { fn drop(&mutself) { unsafe { ifself.is_ok { let _ = ManuallyDrop::take(&mutself.value.ok);
} else { let _ = ManuallyDrop::take(&mutself.value.err);
}
}
}
}
Die Informationen auf dieser Webseite wurden
nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit,
noch Qualität der bereit gestellten Informationen zugesichert.
Bemerkung:
Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.