Struct sized_chunks::ring_buffer::SliceMut [−][src]
An indexable representation of a mutable subset of a RingBuffer
.
Implementations
impl<'a, A: 'a, N: ChunkLength<A> + 'a> SliceMut<'a, A, N>
[src]
#[must_use]pub fn unmut(self) -> Slice<'a, A, N>
[src]
Downgrade this slice into a non-mutable slice.
#[must_use]pub unsafe fn get_unchecked(&self, index: usize) -> &A
[src]
Get an unchecked reference to the value at the given index.
Safety
You must ensure the index is not out of bounds.
#[must_use]pub unsafe fn get_unchecked_mut(&mut self, index: usize) -> &mut A
[src]
Get an unchecked mutable reference to the value at the given index.
Safety
You must ensure the index is not out of bounds.
#[must_use]pub fn iter(&self) -> Iter<'_, A, N>ⓘ
[src]
Get an iterator over references to the items in the slice in order.
#[must_use]pub fn iter_mut(&mut self) -> IterMut<'_, A, N>ⓘ
[src]
Get an iterator over mutable references to the items in the slice in order.
#[must_use]pub fn slice<R: RangeBounds<usize>>(self, range: R) -> SliceMut<'a, A, N>
[src]
Create a subslice of this slice.
This consumes the slice. Because the slice works like a mutable
reference, you can only have one slice over a given subset of a
RingBuffer
at any one time, so that’s just how it’s got to be.
#[must_use]pub fn split_at(self, index: usize) -> (SliceMut<'a, A, N>, SliceMut<'a, A, N>)
[src]
Split the slice into two subslices at the given index.
#[must_use]pub fn to_owned(&self) -> RingBuffer<A, N>ⓘNotable traits for RingBuffer<u8, N>
impl<N: ChunkLength<u8>> Read for RingBuffer<u8, N>impl<N: ChunkLength<u8>> Write for RingBuffer<u8, N>
where
A: Clone,
[src]
Notable traits for RingBuffer<u8, N>
impl<N: ChunkLength<u8>> Read for RingBuffer<u8, N>impl<N: ChunkLength<u8>> Write for RingBuffer<u8, N>
A: Clone,
Construct a new RingBuffer
by copying the elements in this slice.
Trait Implementations
impl<'a, A: 'a, N: ChunkLength<A> + 'a> Array for SliceMut<'a, A, N>
[src]
#[must_use]fn get(&self, index: usize) -> Option<&A>
[src]
Get a reference to the value at a given index.
pub fn first(&self) -> Option<&Self::Output>
[src]
pub fn last(&self) -> Option<&Self::Output>
[src]
pub fn contains(&self, target: &Self::Output) -> bool where
Self::Output: PartialEq<Self::Output>,
[src]
Self::Output: PartialEq<Self::Output>,
pub fn binary_search(&self, target: &Self::Output) -> Result<usize, usize> where
Self::Output: Ord,
[src]
Self::Output: Ord,
pub fn binary_search_by<F>(&self, compare: F) -> Result<usize, usize> where
F: FnMut(&Self::Output) -> Ordering,
[src]
F: FnMut(&Self::Output) -> Ordering,
pub fn binary_search_by_key<K, F>(
&self,
key: &K,
extract: F
) -> Result<usize, usize> where
K: Ord,
F: FnMut(&Self::Output) -> K,
[src]
&self,
key: &K,
extract: F
) -> Result<usize, usize> where
K: Ord,
F: FnMut(&Self::Output) -> K,
pub fn is_sorted(&self) -> bool where
Self::Output: PartialOrd<Self::Output>,
[src]
Self::Output: PartialOrd<Self::Output>,
pub fn is_sorted_by<F>(&self, compare: F) -> bool where
F: FnMut(&Self::Output, &Self::Output) -> Option<Ordering>,
[src]
F: FnMut(&Self::Output, &Self::Output) -> Option<Ordering>,
pub fn is_sorted_by_key<K, F>(&self, extract: F) -> bool where
K: PartialOrd<K>,
F: FnMut(&Self::Output) -> K,
[src]
K: PartialOrd<K>,
F: FnMut(&Self::Output) -> K,
pub fn starts_with(&self, slice: &[Self::Output]) -> bool where
Self::Output: PartialEq<Self::Output>,
Self::Output: Sized,
[src]
Self::Output: PartialEq<Self::Output>,
Self::Output: Sized,
pub fn ends_with(&self, slice: &[Self::Output]) -> bool where
Self::Output: PartialEq<Self::Output>,
Self::Output: Sized,
[src]
Self::Output: PartialEq<Self::Output>,
Self::Output: Sized,
impl<'a, A: 'a, N: ChunkLength<A> + 'a> ArrayMut for SliceMut<'a, A, N>
[src]
#[must_use]fn get_mut(&mut self, index: usize) -> Option<&mut A>
[src]
Get a mutable reference to the value at a given index.
pub fn first_mut(&mut self) -> Option<&mut Self::Output>
[src]
pub fn last_mut(&mut self) -> Option<&mut Self::Output>
[src]
pub fn set(&mut self, index: usize, value: Self::Output) -> Option<Self::Output> where
Self::Output: Sized,
[src]
Self::Output: Sized,
pub fn swap(&mut self, index1: usize, index2: usize) where
Self::Output: Sized,
[src]
Self::Output: Sized,
pub fn map_pair<F, A>(&mut self, index1: usize, index2: usize, f: F) -> A where
F: FnMut(&mut Self::Output, &mut Self::Output) -> A,
[src]
F: FnMut(&mut Self::Output, &mut Self::Output) -> A,
pub fn sort_unstable(&mut self) where
Self::Output: Ord,
Self::Output: Sized,
[src]
Self::Output: Ord,
Self::Output: Sized,
pub fn sort_unstable_by<F>(&mut self, compare: F) where
F: FnMut(&Self::Output, &Self::Output) -> Ordering,
Self::Output: Sized,
[src]
F: FnMut(&Self::Output, &Self::Output) -> Ordering,
Self::Output: Sized,
pub fn sort_unstable_by_key<F, K>(&mut self, extract: F) where
K: Ord,
F: FnMut(&Self::Output) -> K,
Self::Output: Sized,
[src]
K: Ord,
F: FnMut(&Self::Output) -> K,
Self::Output: Sized,
impl<'a, A: Debug + 'a, N: ChunkLength<A> + 'a> Debug for SliceMut<'a, A, N>
[src]
impl<'a, A: Eq + 'a, N: ChunkLength<A> + 'a> Eq for SliceMut<'a, A, N>
[src]
impl<'a, A: 'a, N: ChunkLength<A> + 'a> From<&'a mut RingBuffer<A, N>> for SliceMut<'a, A, N>
[src]
#[must_use]fn from(buffer: &'a mut RingBuffer<A, N>) -> Self
[src]
impl<'a, A: 'a, N: ChunkLength<A> + 'a> HasLength for SliceMut<'a, A, N>
[src]
#[must_use]fn len(&self) -> usize
[src]
Get the length of the slice.
pub fn is_empty(&self) -> bool
[src]
impl<'a, A: Hash + 'a, N: ChunkLength<A> + 'a> Hash for SliceMut<'a, A, N>
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl<'a, A: 'a, N: ChunkLength<A> + 'a> Index<usize> for SliceMut<'a, A, N>
[src]
type Output = A
The returned type after indexing.
#[must_use]fn index(&self, index: usize) -> &Self::Output
[src]
impl<'a, A: 'a, N: ChunkLength<A> + 'a> IndexMut<usize> for SliceMut<'a, A, N>
[src]
impl<'a, A: 'a, N: ChunkLength<A> + 'a> Into<Slice<'a, A, N>> for SliceMut<'a, A, N>
[src]
impl<'a, 'b, A: 'a, N: ChunkLength<A> + 'a> IntoIterator for &'a SliceMut<'a, A, N>
[src]
type Item = &'a A
The type of the elements being iterated over.
type IntoIter = Iter<'a, A, N>
Which kind of iterator are we turning this into?
#[must_use]fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, 'b, A: 'a, N: ChunkLength<A> + 'a> IntoIterator for &'a mut SliceMut<'a, A, N>
[src]
type Item = &'a mut A
The type of the elements being iterated over.
type IntoIter = IterMut<'a, A, N>
Which kind of iterator are we turning this into?
#[must_use]fn into_iter(self) -> Self::IntoIter
[src]
impl<'a, A: Ord + 'a, N: ChunkLength<A> + 'a> Ord for SliceMut<'a, A, N>
[src]
#[must_use]fn cmp(&self, other: &Self) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a> PartialEq<RingBuffer<A, N>> for SliceMut<'a, A, N>
[src]
#[must_use]fn eq(&self, other: &RingBuffer<A, N>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a, S> PartialEq<S> for SliceMut<'a, A, N> where
S: Borrow<[A]>,
[src]
S: Borrow<[A]>,
#[must_use]fn eq(&self, other: &S) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a> PartialEq<Slice<'a, A, N>> for SliceMut<'a, A, N>
[src]
#[must_use]fn eq(&self, other: &Slice<'a, A, N>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<A, N> PartialEq<SliceMut<'_, A, N>> for RingBuffer<A, N> where
A: PartialEq,
N: ChunkLength<A>,
[src]
A: PartialEq,
N: ChunkLength<A>,
fn eq(&self, other: &SliceMut<'_, A, N>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a> PartialEq<SliceMut<'a, A, N>> for Slice<'a, A, N>
[src]
#[must_use]fn eq(&self, other: &SliceMut<'a, A, N>) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a> PartialEq<SliceMut<'a, A, N>> for SliceMut<'a, A, N>
[src]
#[must_use]fn eq(&self, other: &Self) -> bool
[src]
#[must_use]pub fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
impl<'a, A: PartialOrd + 'a, N: ChunkLength<A> + 'a> PartialOrd<SliceMut<'a, A, N>> for SliceMut<'a, A, N>
[src]
#[must_use]fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
Auto Trait Implementations
impl<'a, A, N> RefUnwindSafe for SliceMut<'a, A, N> where
N: RefUnwindSafe,
<N as ChunkLength<A>>::SizedType: RefUnwindSafe,
N: RefUnwindSafe,
<N as ChunkLength<A>>::SizedType: RefUnwindSafe,
impl<'a, A, N> Send for SliceMut<'a, A, N> where
N: Send,
<N as ChunkLength<A>>::SizedType: Send,
N: Send,
<N as ChunkLength<A>>::SizedType: Send,
impl<'a, A, N> Sync for SliceMut<'a, A, N> where
N: Sync,
<N as ChunkLength<A>>::SizedType: Sync,
N: Sync,
<N as ChunkLength<A>>::SizedType: Sync,
impl<'a, A, N> Unpin for SliceMut<'a, A, N>
impl<'a, A, N> !UnwindSafe for SliceMut<'a, A, N>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Same<T> for T
[src]
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,