pub type DiplomatOption<T> = DiplomatResult<T, ()>;Expand description
A type to represent Option
Used internally to handle Option<T> arguments and return types, and needs to be
used explicitly for optional struct fields.
Aliased Type§
#[repr(C)]pub struct DiplomatOption<T> {
value: DiplomatResultValue<T, ()>,
pub is_ok: bool,
}Fields§
§value: DiplomatResultValue<T, ()>§is_ok: boolImplementations§
Source§impl<T> DiplomatOption<T>
impl<T> DiplomatOption<T>
Sourcepub fn into_option(self) -> Option<T>
pub fn into_option(self) -> Option<T>
Helper for converting into an Option to avoid trait ambiguity errors with Into
Sourcepub fn into_converted_option<U: From<T>>(self) -> Option<U>
pub fn into_converted_option<U: From<T>>(self) -> Option<U>
Helper for converting into an Option with the inner type converted