#[non_exhaustive]#[repr(C)]pub struct OptionVTable {
pub is_some_fn: for<'option> unsafe fn(PtrConst<'option>) -> bool,
pub get_value_fn: for<'option> unsafe fn(PtrConst<'option>) -> Option<PtrConst<'option>>,
pub init_some_fn: for<'option> unsafe fn(PtrUninit<'option>, PtrConst<'_>) -> PtrMut<'option>,
pub init_none_fn: unsafe fn(PtrUninit<'_>) -> PtrMut<'_>,
pub replace_with_fn: for<'option> unsafe fn(PtrMut<'option>, Option<PtrConst<'_>>),
}Expand description
Virtual table for Option<T>
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.is_some_fn: for<'option> unsafe fn(PtrConst<'option>) -> boolcf. OptionIsSomeFn
get_value_fn: for<'option> unsafe fn(PtrConst<'option>) -> Option<PtrConst<'option>>cf. OptionGetValueFn
init_some_fn: for<'option> unsafe fn(PtrUninit<'option>, PtrConst<'_>) -> PtrMut<'option>cf. OptionInitSomeFn
init_none_fn: unsafe fn(PtrUninit<'_>) -> PtrMut<'_>cf. OptionInitNoneFn
replace_with_fn: for<'option> unsafe fn(PtrMut<'option>, Option<PtrConst<'_>>)Implementations§
Source§impl OptionVTable
impl OptionVTable
Sourcepub const fn builder() -> OptionVTableBuilder
pub const fn builder() -> OptionVTableBuilder
Returns a builder for OptionVTable
Trait Implementations§
Source§impl Clone for OptionVTable
impl Clone for OptionVTable
Source§fn clone(&self) -> OptionVTable
fn clone(&self) -> OptionVTable
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for OptionVTable
impl Debug for OptionVTable
Source§impl Hash for OptionVTable
impl Hash for OptionVTable
Source§impl PartialEq for OptionVTable
impl PartialEq for OptionVTable
impl Copy for OptionVTable
impl Eq for OptionVTable
impl StructuralPartialEq for OptionVTable
Auto Trait Implementations§
impl Freeze for OptionVTable
impl RefUnwindSafe for OptionVTable
impl Send for OptionVTable
impl Sync for OptionVTable
impl Unpin for OptionVTable
impl UnwindSafe for OptionVTable
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more