Skip to main content

DiplomatOption

Type Alias DiplomatOption 

Source
pub type DiplomatOption<T> = DiplomatResult<T, ()>;
Expand description

A type to represent Option over FFI.

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: bool

Implementations§

Source§

impl<T> DiplomatOption<T>

Source

pub fn into_option(self) -> Option<T>

Helper for converting into an Option to avoid trait ambiguity errors with Into

Source

pub fn into_converted_option<U: From<T>>(self) -> Option<U>

Helper for converting into an Option with the inner type converted

Trait Implementations§

Source§

impl<T> From<Option<T>> for DiplomatOption<T>

Source§

fn from(option: Option<T>) -> Self

Converts to this type from the input type.