pub struct Present;Expand description
Marker indicating a field is present with a concrete value.
Trait Implementations§
Source§impl Presence for Present
impl Presence for Present
Source§type OptionOrSelf = Present
type OptionOrSelf = Present
Presence when combined with Option.
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 Present
impl RefUnwindSafe for Present
impl Send for Present
impl Sync for Present
impl Unpin for Present
impl UnsafeUnpin for Present
impl UnwindSafe for Present
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