Struct rev_slice::RevSlice [−][src]
pub struct RevSlice<T>(_);
A DST newtype providing a reversed view of a slice.
Methods
impl<T> RevSlice<T>
[src]
impl<T> RevSlice<T>
pub fn rev(&self) -> &[T]
[src]
pub fn rev(&self) -> &[T]
Provides a reversed view of the reversed slice, aka the original slice.
pub fn rev_mut(&mut self) -> &mut [T]
[src]
pub fn rev_mut(&mut self) -> &mut [T]
Provides a reversed view of the reversed slice, aka the original mutable slice.
impl<T> RevSlice<T>
[src]
impl<T> RevSlice<T>
These methods work like their equivalents in core
.
pub fn len(&self) -> usize
[src]
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
[src]
pub fn is_empty(&self) -> bool
pub fn first(&self) -> Option<&T>
[src]
pub fn first(&self) -> Option<&T>
pub fn first_mut(&mut self) -> Option<&mut T>
[src]
pub fn first_mut(&mut self) -> Option<&mut T>
pub fn last(&self) -> Option<&T>
[src]
pub fn last(&self) -> Option<&T>
pub fn last_mut(&mut self) -> Option<&mut T>
[src]
pub fn last_mut(&mut self) -> Option<&mut T>
pub fn split_first(&self) -> Option<(&T, &RevSlice<T>)>
[src]
pub fn split_first(&self) -> Option<(&T, &RevSlice<T>)>
pub fn split_first_mut(&mut self) -> Option<(&T, &RevSlice<T>)>
[src]
pub fn split_first_mut(&mut self) -> Option<(&T, &RevSlice<T>)>
pub fn split_last(&self) -> Option<(&T, &RevSlice<T>)>
[src]
pub fn split_last(&self) -> Option<(&T, &RevSlice<T>)>
pub fn split_last_mut(&mut self) -> Option<(&T, &RevSlice<T>)>
[src]
pub fn split_last_mut(&mut self) -> Option<(&T, &RevSlice<T>)>
pub fn split_at(&self, mid: usize) -> (&RevSlice<T>, &RevSlice<T>)
[src]
pub fn split_at(&self, mid: usize) -> (&RevSlice<T>, &RevSlice<T>)
pub fn split_at_mut(
&mut self,
mid: usize
) -> (&mut RevSlice<T>, &mut RevSlice<T>)
[src]
pub fn split_at_mut(
&mut self,
mid: usize
) -> (&mut RevSlice<T>, &mut RevSlice<T>)
impl<T> RevSlice<T>
[src]
impl<T> RevSlice<T>
pub fn iter(&self) -> Rev<Iter<T>>
[src]
pub fn iter(&self) -> Rev<Iter<T>>
my_slice.rev().iter()
and my_slice.iter().rev()
are equivalent.
pub fn iter_mut(&mut self) -> Rev<IterMut<T>>
[src]
pub fn iter_mut(&mut self) -> Rev<IterMut<T>>
my_slice.rev().iter_mut()
and my_slice.iter_mut().rev()
are equivalent.
Trait Implementations
impl<T: Debug> Debug for RevSlice<T>
[src]
impl<T: Debug> Debug for RevSlice<T>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<T: PartialEq> PartialEq for RevSlice<T>
[src]
impl<T: PartialEq> PartialEq for RevSlice<T>
fn eq(&self, other: &RevSlice<T>) -> bool
[src]
fn eq(&self, other: &RevSlice<T>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &RevSlice<T>) -> bool
[src]
fn ne(&self, other: &RevSlice<T>) -> bool
This method tests for !=
.
impl<T: Eq> Eq for RevSlice<T>
[src]
impl<T: Eq> Eq for RevSlice<T>
impl<T: PartialOrd> PartialOrd for RevSlice<T>
[src]
impl<T: PartialOrd> PartialOrd for RevSlice<T>
fn partial_cmp(&self, other: &RevSlice<T>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &RevSlice<T>) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
fn lt(&self, other: &RevSlice<T>) -> bool
[src]
fn lt(&self, other: &RevSlice<T>) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
fn le(&self, other: &RevSlice<T>) -> bool
[src]
fn le(&self, other: &RevSlice<T>) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
fn gt(&self, other: &RevSlice<T>) -> bool
[src]
fn gt(&self, other: &RevSlice<T>) -> bool
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
fn ge(&self, other: &RevSlice<T>) -> bool
[src]
fn ge(&self, other: &RevSlice<T>) -> bool
This method tests greater than or equal to (for self
and other
) and is used by the >=
operator. Read more
impl<T: Ord> Ord for RevSlice<T>
[src]
impl<T: Ord> Ord for RevSlice<T>
fn cmp(&self, other: &RevSlice<T>) -> Ordering
[src]
fn cmp(&self, other: &RevSlice<T>) -> Ordering
This method returns an Ordering
between self
and other
. Read more
fn max(self, other: Self) -> Self
1.21.0[src]
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
fn min(self, other: Self) -> Self
1.21.0[src]
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
impl<T> Index<usize> for RevSlice<T>
[src]
impl<T> Index<usize> for RevSlice<T>
type Output = T
The returned type after indexing.
fn index(&self, index: usize) -> &Self::Output
[src]
fn index(&self, index: usize) -> &Self::Output
Performs the indexing (container[index]
) operation.
impl<T> IndexMut<usize> for RevSlice<T>
[src]
impl<T> IndexMut<usize> for RevSlice<T>
fn index_mut(&mut self, index: usize) -> &mut Self::Output
[src]
fn index_mut(&mut self, index: usize) -> &mut Self::Output
Performs the mutable indexing (container[index]
) operation.
impl<T> Index<Range<usize>> for RevSlice<T>
[src]
impl<T> Index<Range<usize>> for RevSlice<T>
type Output = RevSlice<T>
The returned type after indexing.
fn index(&self, index: Range<usize>) -> &Self::Output
[src]
fn index(&self, index: Range<usize>) -> &Self::Output
Performs the indexing (container[index]
) operation.
impl<T> IndexMut<Range<usize>> for RevSlice<T>
[src]
impl<T> IndexMut<Range<usize>> for RevSlice<T>
fn index_mut(&mut self, index: Range<usize>) -> &mut Self::Output
[src]
fn index_mut(&mut self, index: Range<usize>) -> &mut Self::Output
Performs the mutable indexing (container[index]
) operation.
impl<'a, T> IntoIterator for &'a RevSlice<T>
[src]
impl<'a, T> IntoIterator for &'a RevSlice<T>
type Item = &'a T
The type of the elements being iterated over.
type IntoIter = Rev<Iter<'a, T>>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a, T> IntoIterator for &'a mut RevSlice<T>
[src]
impl<'a, T> IntoIterator for &'a mut RevSlice<T>