IndexSlice

Struct IndexSlice 

Source
pub struct IndexSlice<I, T> { /* private fields */ }

Implementations§

Source§

impl<I, T> IndexSlice<I, T>
where I: IndexingType,

Source

pub fn iter_enumerated( &self, initial_offset: I, ) -> IndexIterEnumerated<I, Iter<'_, T>>

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source

pub fn first(&self) -> Option<&T>

Source

pub fn first_mut(&mut self) -> Option<&mut T>

Source

pub fn last(&self) -> Option<&T>

Source

pub fn last_mut(&mut self) -> Option<&mut T>

Source

pub fn as_slice(&self) -> &[T]

Source

pub fn as_slice_mut(&mut self) -> &mut [T]

Source

pub fn from_boxed_slice(slice_box: Box<[T]>) -> Box<IndexSlice<I, T>>

Source

pub fn next_idx(&self) -> I

Source

pub fn last_idx(&self) -> Option<I>

Source

pub fn get(&self, idx: I) -> Option<&T>

Source

pub fn get_mut(&mut self, idx: I) -> Option<&mut T>

Source

pub fn iter(&self) -> Iter<'_, T>

Source

pub fn iter_mut(&mut self) -> IterMut<'_, T>

Source

pub fn two_distinct_mut(&mut self, a: I, b: I) -> (&mut T, &mut T)

Source

pub fn multi_ref_mut_handout<const CAP: usize>( &mut self, ) -> MultiRefMutHandout<'_, I, T, CAP>

Source

pub fn ref_handout_stack(&mut self) -> RefHandoutStackBase<'_, I, T>

Source

pub fn split_at_mut( &mut self, idx: I, ) -> (&mut IndexSlice<I, T>, &mut IndexSlice<I, T>)

Trait Implementations§

Source§

impl<I, T> Debug for IndexSlice<I, T>
where I: IndexingType, T: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<I, T> Hash for IndexSlice<I, T>
where I: Hash, T: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
Source§

impl<I, T> Index<I> for IndexSlice<I, T>
where I: IndexingType,

Source§

type Output = T

The returned type after indexing.
Source§

fn index(&self, index: I) -> &<IndexSlice<I, T> as Index<I>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> Index<Range<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index( &self, index: Range<I>, ) -> &<IndexSlice<I, T> as Index<Range<I>>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> Index<RangeFrom<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index( &self, rb: RangeFrom<I>, ) -> &<IndexSlice<I, T> as Index<RangeFrom<I>>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> Index<RangeInclusive<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index( &self, rb: RangeInclusive<I>, ) -> &<IndexSlice<I, T> as Index<RangeInclusive<I>>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> Index<RangeTo<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index( &self, rb: RangeTo<I>, ) -> &<IndexSlice<I, T> as Index<RangeTo<I>>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> Index<RangeToInclusive<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

type Output = IndexSlice<I, T>

The returned type after indexing.
Source§

fn index( &self, rb: RangeToInclusive<I>, ) -> &<IndexSlice<I, T> as Index<RangeToInclusive<I>>>::Output

Performs the indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<I> for IndexSlice<I, T>
where I: IndexingType,

Source§

fn index_mut(&mut self, index: I) -> &mut <IndexSlice<I, T> as Index<I>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<Range<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

fn index_mut( &mut self, index: Range<I>, ) -> &mut <IndexSlice<I, T> as Index<Range<I>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<RangeFrom<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

fn index_mut( &mut self, rb: RangeFrom<I>, ) -> &mut <IndexSlice<I, T> as Index<RangeFrom<I>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<RangeInclusive<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

fn index_mut( &mut self, rb: RangeInclusive<I>, ) -> &mut <IndexSlice<I, T> as Index<RangeInclusive<I>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<RangeTo<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

fn index_mut( &mut self, rb: RangeTo<I>, ) -> &mut <IndexSlice<I, T> as Index<RangeTo<I>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<I, T> IndexMut<RangeToInclusive<I>> for IndexSlice<I, T>
where I: IndexingType,

Source§

fn index_mut( &mut self, rb: RangeToInclusive<I>, ) -> &mut <IndexSlice<I, T> as Index<RangeToInclusive<I>>>::Output

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl<'a, I, T> IntoIterator for &'a IndexSlice<I, T>
where I: IndexingType,

Source§

type Item = &'a T

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a IndexSlice<I, T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, I, T> IntoIterator for &'a mut IndexSlice<I, T>
where I: IndexingType,

Source§

type Item = &'a mut T

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, T>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> <&'a mut IndexSlice<I, T> as IntoIterator>::IntoIter

Creates an iterator from a value. Read more
Source§

impl<I, T> Ord for IndexSlice<I, T>
where I: Ord, T: Ord,

Source§

fn cmp(&self, other: &IndexSlice<I, T>) -> Ordering

This method returns an Ordering between self and other. Read more
Source§

impl<I, T> PartialEq<[T]> for IndexSlice<I, T>
where I: IndexingType, T: PartialEq,

Source§

fn eq(&self, other: &[T]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, T, const N: usize> PartialEq<[T; N]> for IndexSlice<I, T>
where I: IndexingType, T: PartialEq,

Source§

fn eq(&self, other: &[T; N]) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, T> PartialEq<IndexSlice<I, T>> for [T]
where I: IndexingType, T: PartialEq,

Source§

fn eq(&self, other: &IndexSlice<I, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, T> PartialEq<IndexSlice<I, T>> for IndexVec<I, T>
where I: IndexingType, T: PartialEq,

Source§

fn eq(&self, other: &IndexSlice<I, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, T> PartialEq<IndexVec<I, T>> for IndexSlice<I, T>
where I: IndexingType, T: PartialEq,

Source§

fn eq(&self, other: &IndexVec<I, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, T> PartialEq for IndexSlice<I, T>
where I: PartialEq, T: PartialEq,

Source§

fn eq(&self, other: &IndexSlice<I, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<I, T> PartialOrd for IndexSlice<I, T>
where I: PartialOrd, T: PartialOrd,

Source§

fn partial_cmp(&self, other: &IndexSlice<I, T>) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl<I, T> RefCast for IndexSlice<I, T>

Source§

type From = [T]

Source§

fn ref_cast(_from: &<IndexSlice<I, T> as RefCast>::From) -> &IndexSlice<I, T>

Source§

fn ref_cast_mut( _from: &mut <IndexSlice<I, T> as RefCast>::From, ) -> &mut IndexSlice<I, T>

Source§

impl<I, T> Eq for IndexSlice<I, T>
where I: Eq, T: Eq,

Source§

impl<I, T> StructuralPartialEq for IndexSlice<I, T>

Auto Trait Implementations§

§

impl<I, T> Freeze for IndexSlice<I, T>
where T: Freeze,

§

impl<I, T> RefUnwindSafe for IndexSlice<I, T>
where T: RefUnwindSafe,

§

impl<I, T> Send for IndexSlice<I, T>
where T: Send,

§

impl<I, T> !Sized for IndexSlice<I, T>

§

impl<I, T> Sync for IndexSlice<I, T>
where T: Sync,

§

impl<I, T> Unpin for IndexSlice<I, T>
where T: Unpin,

§

impl<I, T> UnwindSafe for IndexSlice<I, T>
where T: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<Q, K> Comparable<K> for Q
where Q: Ord + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.