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
Presence when combined with 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§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.
Auto Trait Implementations§
impl Freeze for Optional
impl RefUnwindSafe for Optional
impl Send for Optional
impl Sync for Optional
impl Unpin for Optional
impl UnsafeUnpin for Optional
impl UnwindSafe for Optional
Blanket Implementations§
Source§impl<T> Access<T> for T
impl<T> Access<T> for T
Source§const IS_ABSENT: bool = const IS_ABSENT: bool = false;
const IS_ABSENT: bool = const IS_ABSENT: bool = false;
Compile-time constant indicating if this field is absent.
Source§type RemainderFrom<Source: Access<T>> = PhantomData<T>
type RemainderFrom<Source: Access<T>> = PhantomData<T>
Remainder type when extracting Self from Source.
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Consume and convert to Option.
Source§fn from_value(value: T) -> (T, <T as Access<T>>::RemainderFrom<T>)
fn from_value(value: T) -> (T, <T as Access<T>>::RemainderFrom<T>)
Construct from a value.
Source§fn try_from_option(
value: Option<T>,
) -> Result<(T, <T as Access<T>>::RemainderFrom<Option<T>>), Option<T>>
fn try_from_option( value: Option<T>, ) -> Result<(T, <T as Access<T>>::RemainderFrom<Option<T>>), Option<T>>
Try to construct from an option. Read more
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
Source§impl<T, A> Extract<PhantomData<T>, T> for A
impl<T, A> Extract<PhantomData<T>, T> for A
Source§fn extract(
self,
) -> (PhantomData<T>, <PhantomData<T> as Access<T>>::RemainderFrom<A>)
fn extract( self, ) -> (PhantomData<T>, <PhantomData<T> as Access<T>>::RemainderFrom<A>)
Extract a value into target type and remainder parts.
Source§impl<T> Extract<T, T> for T
impl<T> Extract<T, T> for T
Source§fn extract(self) -> (T, <T as Access<T>>::RemainderFrom<T>)
fn extract(self) -> (T, <T as Access<T>>::RemainderFrom<T>)
Extract a value into target type and remainder parts.
Source§impl<T> InferPresence<T> for T
impl<T> InferPresence<T> for T
Source§impl<T, A> TryExtract<A, T> for Twhere
A: Access<T>,
impl<T, A> TryExtract<A, T> for Twhere
A: Access<T>,
Source§fn try_extract(self) -> Result<(A, <A as Access<T>>::RemainderFrom<T>), T>
fn try_extract(self) -> Result<(A, <A as Access<T>>::RemainderFrom<T>), T>
Try to extract a value into target type and remainder parts. Read more