pub struct Absent;Expand description
Marker indicating a field is absent (PhantomData).
Trait Implementations§
Source§impl Presence for Absent
impl Presence for Absent
Source§type OptionOrSelf = Optional
type OptionOrSelf = Optional
Presence when combined with Option.
Source§type Output<T> = PhantomData<T>
type Output<T> = PhantomData<T>
Container type (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.
Auto Trait Implementations§
impl Freeze for Absent
impl RefUnwindSafe for Absent
impl Send for Absent
impl Sync for Absent
impl Unpin for Absent
impl UnsafeUnpin for Absent
impl UnwindSafe for Absent
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