[−][src]Struct sized_chunks::ring_buffer::Slice
Methods
impl<'a, A: 'a, N: ChunkLength<A> + 'a> Slice<'a, A, N>
[src]
#[must_use]
pub fn len(&self) -> usize
[src]
Get the length of the ring buffer.
#[must_use]
pub fn is_empty(&self) -> bool
[src]
Test if the ring buffer is empty.
#[must_use]
pub fn get(&self, index: usize) -> Option<&A>
[src]
Get the value at a given index.
#[must_use]
pub fn first(&self) -> Option<&A>
[src]
Get the first value in the buffer.
#[must_use]
pub fn last(&self) -> Option<&A>
[src]
Get the last value in the buffer.
ⓘImportant traits for Iter<'a, A, N>#[must_use]
pub fn iter(&self) -> Iter<A, N>
[src]
#[must_use]
pub fn slice<R: RangeBounds<usize>>(self, range: R) -> Slice<'a, A, N>
[src]
#[must_use]
pub fn split_at(self, index: usize) -> (Slice<'a, A, N>, Slice<'a, A, N>)
[src]
ⓘImportant traits for RingBuffer<u8, N>#[must_use]
pub fn to_owned(&self) -> RingBuffer<A, N> where
A: Clone,
[src]
A: Clone,
Trait Implementations
impl<'a, A: Eq + 'a, N: ChunkLength<A> + 'a> Eq for Slice<'a, A, N>
[src]
impl<'a, A: PartialOrd + 'a, N: ChunkLength<A> + 'a> PartialOrd<Slice<'a, A, N>> for Slice<'a, A, N>
[src]
#[must_use]
fn partial_cmp(&self, other: &Self) -> Option<Ordering>
[src]
#[must_use]
default fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]
default fn le(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
#[must_use]
default fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
#[must_use]
default fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a> PartialEq<Slice<'a, A, N>> for Slice<'a, A, N>
[src]
#[must_use]
fn eq(&self, other: &Self) -> bool
[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, A: PartialEq + 'a, N: ChunkLength<A> + 'a, S> PartialEq<S> for Slice<'a, A, N> where
S: Borrow<[A]>,
[src]
S: Borrow<[A]>,
#[must_use]
fn eq(&self, other: &S) -> bool
[src]
#[must_use]
default fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.
impl<'a, A: 'a, N: ChunkLength<A> + 'a> Clone for Slice<'a, A, N>
[src]
#[must_use]
fn clone(&self) -> Self
[src]
default fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl<'a, A: Ord + 'a, N: ChunkLength<A> + 'a> Ord for Slice<'a, A, N>
[src]
#[must_use]
fn cmp(&self, other: &Self) -> Ordering
[src]
default fn max(self, other: Self) -> Self
1.21.0[src]
Compares and returns the maximum of two values. Read more
default fn min(self, other: Self) -> Self
1.21.0[src]
Compares and returns the minimum of two values. Read more
default fn clamp(self, min: Self, max: Self) -> Self
[src]
clamp
)Restrict a value to a certain interval. Read more
impl<'a, A: 'a, N: ChunkLength<A> + 'a> From<&'a RingBuffer<A, N>> for Slice<'a, A, N>
[src]
#[must_use]
fn from(buffer: &'a RingBuffer<A, N>) -> Self
[src]
impl<'a, 'b, A: 'a, N: ChunkLength<A> + 'a> IntoIterator for &'a Slice<'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, A: 'a, N: ChunkLength<A> + 'a> Into<Slice<'a, A, N>> for SliceMut<'a, A, N>
[src]
impl<'a, A: Debug + 'a, N: ChunkLength<A> + 'a> Debug for Slice<'a, A, N>
[src]
impl<'a, A: Hash + 'a, N: ChunkLength<A> + 'a> Hash for Slice<'a, A, N>
[src]
fn hash<H: Hasher>(&self, hasher: &mut H)
[src]
default fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
Feeds a slice of this type into the given [Hasher
]. Read more
impl<'a, A: 'a, N: ChunkLength<A> + 'a> Index<usize> for Slice<'a, A, N>
[src]
Auto Trait Implementations
impl<'a, A, N> Send for Slice<'a, A, N> where
A: Sync,
N: Sync,
<N as ChunkLength<A>>::SizedType: Sync,
A: Sync,
N: Sync,
<N as ChunkLength<A>>::SizedType: Sync,
impl<'a, A, N> Sync for Slice<'a, A, N> where
A: Sync,
N: Sync,
<N as ChunkLength<A>>::SizedType: Sync,
A: Sync,
N: Sync,
<N as ChunkLength<A>>::SizedType: Sync,
Blanket Implementations
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Same for T
[src]
type Output = T
Should always be Self