pub struct Optional;Expand description
Marker indicating a field may or may not be present (Option).
Trait Implementations§
Source§impl Presence for Optional
impl Presence for Optional
Source§type OptionOrSelf = Optional
type OptionOrSelf = Optional
The presence state when combined with an Option.
Source§type Or<Other: Presence> = <Other as Presence>::OptionOrSelf
type Or<Other: Presence> = <Other as Presence>::OptionOrSelf
Result of merging this presence with another.
Source§type RemainderFrom<Source: Presence> = Absent
type RemainderFrom<Source: Presence> = Absent
What remains from
Source when extracting Self. Present/Optional → Absent; Absent → Source.Source§type Output<T> = Option<T>
type Output<T> = Option<T>
The container type for values with this presence (T, Option<T>, or
PhantomData<T>).Source§fn or<T, Other: Presence>(
self_: <Self as Presence>::Output<T>,
other: Other::Output<T>,
) -> <<Self as Presence>::Or<Other> as Presence>::Output<T>
fn or<T, Other: Presence>( self_: <Self as Presence>::Output<T>, other: Other::Output<T>, ) -> <<Self as Presence>::Or<Other> as Presence>::Output<T>
Merge two values, preferring the first if present.
Source§fn option_or_self<T>(
option: Option<T>,
self_: <Self as Presence>::Output<T>,
) -> <<Self as Presence>::OptionOrSelf as Presence>::Output<T>
fn option_or_self<T>( option: Option<T>, self_: <Self as Presence>::Output<T>, ) -> <<Self as Presence>::OptionOrSelf as Presence>::Output<T>
Convert an Option into the appropriate presence state.
Source§impl Split<Optional> for Absent
impl Split<Optional> for Absent
Source§fn split<T>(_value: PhantomData<T>) -> (Option<T>, PhantomData<T>)
fn split<T>(_value: PhantomData<T>) -> (Option<T>, PhantomData<T>)
Split a value into selected and remainder parts.
Auto Trait Implementations§
impl Freeze for Optional
impl RefUnwindSafe for Optional
impl Send for Optional
impl Sync for Optional
impl Unpin for Optional
impl UnwindSafe for Optional
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