pub struct ArrayObserver<'ob, const N: usize, O, S: ?Sized, D = Zero> { /* private fields */ }Expand description
Observer implementation for arrays [T; N].
Implementations§
Source§impl<'ob, const N: usize, O, S, D, T> ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D, T> ArrayObserver<'ob, N, O, S, D>
Sourcepub fn as_slice(&self) -> &[O]
pub fn as_slice(&self) -> &[O]
See array::as_slice.
Sourcepub fn as_mut_slice(&mut self) -> &mut [O]
pub fn as_mut_slice(&mut self) -> &mut [O]
See array::as_mut_slice.
Sourcepub fn each_ref(&self) -> [&O; N]
pub fn each_ref(&self) -> [&O; N]
See array::each_ref.
Sourcepub fn each_mut(&mut self) -> [&mut O; N]
pub fn each_mut(&mut self) -> [&mut O; N]
See array::each_mut.
Methods from Deref<Target = SliceObserver<'ob, [O; N], (), S, D>>§
Sourcepub fn first_mut(&mut self) -> Option<&mut O>
pub fn first_mut(&mut self) -> Option<&mut O>
See slice::first_mut.
Sourcepub fn split_first_mut(&mut self) -> Option<(&mut O, &mut [O])>
pub fn split_first_mut(&mut self) -> Option<(&mut O, &mut [O])>
Sourcepub fn split_last_mut(&mut self) -> Option<(&mut O, &mut [O])>
pub fn split_last_mut(&mut self) -> Option<(&mut O, &mut [O])>
Sourcepub fn last_mut(&mut self) -> Option<&mut O>
pub fn last_mut(&mut self) -> Option<&mut O>
See slice::last_mut.
Sourcepub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [O; N]>
pub fn first_chunk_mut<const N: usize>(&mut self) -> Option<&mut [O; N]>
Sourcepub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [O; N]>
pub fn last_chunk_mut<const N: usize>(&mut self) -> Option<&mut [O; N]>
Sourcepub fn swap(&mut self, a: usize, b: usize)
pub fn swap(&mut self, a: usize, b: usize)
See slice::swap.
Sourcepub fn iter_mut(&mut self) -> IterMut<'_, O>
pub fn iter_mut(&mut self) -> IterMut<'_, O>
See slice::iter_mut.
Sourcepub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, O>
pub fn chunks_mut(&mut self, chunk_size: usize) -> ChunksMut<'_, O>
See slice::chunks_mut.
Sourcepub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, O>
pub fn chunks_exact_mut(&mut self, chunk_size: usize) -> ChunksExactMut<'_, O>
Sourcepub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[O; N]], &mut [O])
pub fn as_chunks_mut<const N: usize>(&mut self) -> (&mut [[O; N]], &mut [O])
See slice::as_chunks_mut.
Sourcepub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [O], &mut [[O; N]])
pub fn as_rchunks_mut<const N: usize>(&mut self) -> (&mut [O], &mut [[O; N]])
Sourcepub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, O>
pub fn rchunks_mut(&mut self, chunk_size: usize) -> RChunksMut<'_, O>
See slice::rchunks_mut.
Sourcepub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, O>
pub fn rchunks_exact_mut(&mut self, chunk_size: usize) -> RChunksExactMut<'_, O>
Sourcepub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, O, F>
pub fn chunk_by_mut<F>(&mut self, pred: F) -> ChunkByMut<'_, O, F>
See slice::chunk_by_mut.
Sourcepub fn split_at_mut(&mut self, mid: usize) -> (&mut [O], &mut [O])
pub fn split_at_mut(&mut self, mid: usize) -> (&mut [O], &mut [O])
See slice::split_at_mut.
Sourcepub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, O, F>
pub fn split_mut<F>(&mut self, pred: F) -> SplitMut<'_, O, F>
See slice::split_mut.
Sourcepub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, O, F>
pub fn split_inclusive_mut<F>(&mut self, pred: F) -> SplitInclusiveMut<'_, O, F>
Sourcepub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, O, F>
pub fn rsplit_mut<F>(&mut self, pred: F) -> RSplitMut<'_, O, F>
See slice::rsplit_mut.
Sourcepub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, O, F>
pub fn splitn_mut<F>(&mut self, n: usize, pred: F) -> SplitNMut<'_, O, F>
See slice::splitn_mut.
Sourcepub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, O, F>
pub fn rsplitn_mut<F>(&mut self, n: usize, pred: F) -> RSplitNMut<'_, O, F>
See slice::rsplitn_mut.
Trait Implementations§
Source§impl<'ob, const N: usize, O, S: ?Sized, D> AsNormalized for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S: ?Sized, D> AsNormalized for ArrayObserver<'ob, N, O, S, D>
Source§type OuterDepth = Succ<Succ<Zero>>
type OuterDepth = Succ<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, const N: usize, O, S, D, T> Debug for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D, T> Debug for ArrayObserver<'ob, N, O, S, D>
Source§impl<'ob, const N: usize, O, S, D, T, I> Index<I> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = Vec<T>> + 'ob + ?Sized,
O: Observer<'ob, InnerDepth = Zero, Head = T> + 'ob,
T: 'ob,
I: SliceIndex<[O]> + SliceIndexImpl<[O], I::Output>,
impl<'ob, const N: usize, O, S, D, T, I> Index<I> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = Vec<T>> + 'ob + ?Sized,
O: Observer<'ob, InnerDepth = Zero, Head = T> + 'ob,
T: 'ob,
I: SliceIndex<[O]> + SliceIndexImpl<[O], I::Output>,
Source§impl<'ob, const N: usize, O, S, D, T, I> IndexMut<I> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = Vec<T>> + 'ob + ?Sized,
O: Observer<'ob, InnerDepth = Zero, Head = T> + 'ob,
T: 'ob,
I: SliceIndex<[O]> + SliceIndexImpl<[O], I::Output>,
impl<'ob, const N: usize, O, S, D, T, I> IndexMut<I> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = Vec<T>> + 'ob + ?Sized,
O: Observer<'ob, InnerDepth = Zero, Head = T> + 'ob,
T: 'ob,
I: SliceIndex<[O]> + SliceIndexImpl<[O], I::Output>,
Source§impl<'ob, const N: usize, O, S, D, T> Observer<'ob> for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D, T> Observer<'ob> for ArrayObserver<'ob, N, O, S, D>
Source§type InnerDepth = D
type InnerDepth = D
Type-level number of dereferences from
Head to the observed type.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 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§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, const N: usize, O, S, D, T, U> PartialEq<U> for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D, T, U> PartialEq<U> for ArrayObserver<'ob, N, O, S, D>
Source§impl<'ob, const N: usize, O, S, D, T, U> PartialOrd<U> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = [T; N]> + ?Sized,
O: Observer<'ob, InnerDepth = Zero, Head = T>,
[T; N]: PartialOrd<U>,
impl<'ob, const N: usize, O, S, D, T, U> PartialOrd<U> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = [T; N]> + ?Sized,
O: Observer<'ob, InnerDepth = Zero, Head = T>,
[T; N]: PartialOrd<U>,
Source§impl<'ob, const N: usize, O, S, D, T> SerializeObserver<'ob> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = [T; N]> + 'ob + ?Sized,
O: SerializeObserver<'ob, InnerDepth = Zero, Head = T>,
T: Serialize,
impl<'ob, const N: usize, O, S, D, T> SerializeObserver<'ob> for ArrayObserver<'ob, N, O, S, D>where
D: Unsigned,
S: AsDerefMut<D, Target = [T; N]> + 'ob + ?Sized,
O: SerializeObserver<'ob, InnerDepth = Zero, Head = T>,
T: Serialize,
Auto Trait Implementations§
impl<'ob, const N: usize, O, S, D = Zero> !Freeze for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D = Zero> !RefUnwindSafe for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D = Zero> !Send for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D = Zero> !Sync for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D> Unpin for ArrayObserver<'ob, N, O, S, D>
impl<'ob, const N: usize, O, S, D = Zero> !UnwindSafe for ArrayObserver<'ob, N, 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