pub struct OptionObserver<'ob, O, S: ?Sized, D = Zero> { /* private fields */ }Expand description
Implementations§
Source§impl<'ob, O, S, D> OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D> OptionObserver<'ob, O, S, D>
Sourcepub fn as_mut(&mut self) -> Option<&mut O>
pub fn as_mut(&mut self) -> Option<&mut O>
See Option::as_mut.
Sourcepub fn insert(&mut self, value: O::Head) -> &mut O
pub fn insert(&mut self, value: O::Head) -> &mut O
See Option::insert.
Sourcepub fn get_or_insert(&mut self, value: O::Head) -> &mut O
pub fn get_or_insert(&mut self, value: O::Head) -> &mut O
Sourcepub fn get_or_insert_default(&mut self) -> &mut O
pub fn get_or_insert_default(&mut self) -> &mut O
Sourcepub fn get_or_insert_with<F>(&mut self, f: F) -> &mut O
pub fn get_or_insert_with<F>(&mut self, f: F) -> &mut O
Trait Implementations§
Source§impl<'ob, O, S: ?Sized, D> AsNormalized for OptionObserver<'ob, O, S, D>
impl<'ob, O, S: ?Sized, D> AsNormalized for OptionObserver<'ob, O, S, D>
Source§type OuterDepth = Succ<Zero>
type OuterDepth = Succ<Zero>
The number of outer dereference layers to reach the normalized value.
Source§fn as_normalized_ref(&self) -> &Self::Target
fn as_normalized_ref(&self) -> &Self::Target
Returns a normalized reference to the underlying value.
Source§fn as_normalized_mut(&mut self) -> &mut Self::Targetwhere
Self: AsDerefMutCoinductive<Self::OuterDepth>,
fn as_normalized_mut(&mut self) -> &mut Self::Targetwhere
Self: AsDerefMutCoinductive<Self::OuterDepth>,
Returns a normalized mutable reference to the underlying value.
Source§impl<'ob, O, S, D> Debug for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D> Debug for OptionObserver<'ob, O, S, D>
Source§impl<'ob, O, S: ?Sized, D> Deref for OptionObserver<'ob, O, S, D>
impl<'ob, O, S: ?Sized, D> Deref for OptionObserver<'ob, O, S, D>
Source§impl<'ob, O, S: ?Sized, D> DerefMut for OptionObserver<'ob, O, S, D>
impl<'ob, O, S: ?Sized, D> DerefMut for OptionObserver<'ob, O, S, D>
Source§impl<'ob, O, S, D> Observer<'ob> for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D> Observer<'ob> for OptionObserver<'ob, O, S, D>
Source§type InnerDepth = D
type InnerDepth = D
Type-level number of dereferences from
Head to the observed type.Source§unsafe fn refresh(this: &mut Self, value: &mut Self::Head)
unsafe fn refresh(this: &mut Self, value: &mut Self::Head)
Refreshes the observer’s internal pointer after the observed value has moved. Read more
Source§fn observe(value: &'ob mut Self::Head) -> Self
fn observe(value: &'ob mut Self::Head) -> Self
Creates a new observer for the given value. Read more
Source§unsafe fn force(this: &mut Self, value: &'ob mut Self::Head)
unsafe fn force(this: &mut Self, value: &'ob mut Self::Head)
Forces the observer into a valid state for the given value. Read more
Source§fn as_inner<'i>(
this: &Self,
) -> &'i mut <Self::Head as AsDeref<Self::InnerDepth>>::Target
fn as_inner<'i>( this: &Self, ) -> &'i mut <Self::Head as AsDeref<Self::InnerDepth>>::Target
Gets a mutable reference to the inner observed value without triggering observation. Read more
Source§fn track_inner<'i>(
this: &mut Self,
) -> &'i mut <Self::Head as AsDeref<Self::InnerDepth>>::Target
fn track_inner<'i>( this: &mut Self, ) -> &'i mut <Self::Head as AsDeref<Self::InnerDepth>>::Target
Gets a mutable reference to the inner observed value while triggering observation. Read more
Source§impl<'ob, O, S, D, U: ?Sized> PartialEq<U> for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D, U: ?Sized> PartialEq<U> for OptionObserver<'ob, O, S, D>
Source§impl<'ob, O, S, D, U: ?Sized> PartialOrd<U> for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D, U: ?Sized> PartialOrd<U> for OptionObserver<'ob, O, S, D>
Source§impl<'ob, O, S, D> SerializeObserver<'ob> for OptionObserver<'ob, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = Option<O::Head>> + 'ob + ?Sized,
O: SerializeObserver<'ob, InnerDepth = Zero>,
O::Head: Serialize + Sized,
impl<'ob, O, S, D> SerializeObserver<'ob> for OptionObserver<'ob, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = Option<O::Head>> + 'ob + ?Sized,
O: SerializeObserver<'ob, InnerDepth = Zero>,
O::Head: Serialize + Sized,
Auto Trait Implementations§
impl<'ob, O, S, D = Zero> !Freeze for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D = Zero> !RefUnwindSafe for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D = Zero> !Send for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D = Zero> !Sync for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D> Unpin for OptionObserver<'ob, O, S, D>
impl<'ob, O, S, D = Zero> !UnwindSafe for OptionObserver<'ob, O, S, D>
Blanket Implementations§
Source§impl<T, N> AsDerefCoinductive<Succ<N>> for T
impl<T, N> AsDerefCoinductive<Succ<N>> for T
Source§type Target = <<T as Deref>::Target as AsDerefCoinductive<N>>::Target
type Target = <<T as Deref>::Target as AsDerefCoinductive<N>>::Target
The target type after
N dereferences.Source§fn as_deref_coinductive(&self) -> &<T as AsDerefCoinductive<Succ<N>>>::Target
fn as_deref_coinductive(&self) -> &<T as AsDerefCoinductive<Succ<N>>>::Target
Dereferences self
N times.Source§impl<T> AsDerefCoinductive<Zero> for Twhere
T: ?Sized,
impl<T> AsDerefCoinductive<Zero> for Twhere
T: ?Sized,
Source§impl<T> AsDerefMut<Zero> for Twhere
T: ?Sized,
impl<T> AsDerefMut<Zero> for Twhere
T: ?Sized,
Source§fn as_deref_mut(&mut self) -> &mut T
fn as_deref_mut(&mut self) -> &mut T
Mutably dereferences self
N times.Source§impl<T, N> AsDerefMutCoinductive<Succ<N>> for T
impl<T, N> AsDerefMutCoinductive<Succ<N>> for T
Source§fn as_deref_mut_coinductive(
&mut self,
) -> &mut <T as AsDerefCoinductive<Succ<N>>>::Target
fn as_deref_mut_coinductive( &mut self, ) -> &mut <T as AsDerefCoinductive<Succ<N>>>::Target
Mutably dereferences self
N times.Source§impl<T> AsDerefMutCoinductive<Zero> for Twhere
T: ?Sized,
impl<T> AsDerefMutCoinductive<Zero> for Twhere
T: ?Sized,
Source§fn as_deref_mut_coinductive(&mut self) -> &mut T
fn as_deref_mut_coinductive(&mut self) -> &mut T
Mutably dereferences self
N times.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