Skip to main content

TypedSlice

Struct TypedSlice 

Source
pub struct TypedSlice<I: IndexType, T> { /* private fields */ }
Expand description

A slice wrapper that uses a custom index type.

Implementations§

Source§

impl<I: IndexType, T> TypedSlice<I, T>

Source

pub fn try_from_slice(slice: &[T]) -> Result<&Self, I::IndexTooBigError>

Tries to create a TypedSlice from a raw slice.

Source

pub fn try_from_slice_mut( slice: &mut [T], ) -> Result<&mut Self, I::IndexTooBigError>

Tries to create a mutable TypedSlice from a mutable raw slice.

Source

pub unsafe fn from_raw_parts<'a>(data: *const T, len: I) -> &'a TypedSlice<I, T>

Creates a TypedSlice from raw parts.

§Safety

See core::slice::from_raw_parts.

Source

pub unsafe fn from_raw_parts_mut<'a>( data: *mut T, len: I, ) -> &'a mut TypedSlice<I, T>

Creates a mutable TypedSlice from raw parts.

§Safety

See core::slice::from_raw_parts_mut.

Source

pub const unsafe fn from_slice_unchecked(slice: &[T]) -> &Self

Creates a TypedSlice from a raw slice without checking if its length is in bounds for I.

§Safety

The length of the slice must be less than or equal to I::MAX_RAW_INDEX.

Source

pub const unsafe fn from_slice_unchecked_mut(slice: &mut [T]) -> &mut Self

Creates a mutable TypedSlice from a mutable raw slice without checking if its length is in bounds for I.

§Safety

The length of the slice must be less than or equal to I::MAX_RAW_INDEX.

Source

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

Returns the TypedSlice as a raw slice reference.

Source

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

Returns the TypedSlice as a mutable raw slice reference.

Source

pub fn cast_index_type<I2: IndexType>( &self, ) -> Result<&TypedSlice<I2, T>, I2::IndexTooBigError>

Casts the index type of the TypedSlice.

Source

pub fn cast_index_type_mut<I2: IndexType>( &mut self, ) -> Result<&mut TypedSlice<I2, T>, I2::IndexTooBigError>

Casts the index type of the mutable TypedSlice.

Source

pub const fn len_usize(&self) -> usize

Returns the length of the slice as a usize.

Source

pub fn len(&self) -> I

Returns the length of the slice as an index.

Source

pub const fn is_empty(&self) -> bool

Returns true if the slice is empty.

Source

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

Source

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

Source

pub const fn split_first(&self) -> Option<(&T, &TypedSlice<I, T>)>

Source

pub const fn split_first_mut( &mut self, ) -> Option<(&mut T, &mut TypedSlice<I, T>)>

Source

pub const fn split_last(&self) -> Option<(&T, &TypedSlice<I, T>)>

Source

pub const fn split_last_mut( &mut self, ) -> Option<(&mut T, &mut TypedSlice<I, T>)>

Source

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

Source

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

Source

pub const fn first_chunk<const N: usize>(&self) -> Option<&TypedArray<I, T, N>>

Source

pub const fn first_chunk_mut<const N: usize>( &mut self, ) -> Option<&mut TypedArray<I, T, N>>

Source

pub const fn split_first_chunk<const N: usize>( &self, ) -> Option<(&TypedArray<I, T, N>, &TypedSlice<I, T>)>

Source

pub const fn split_first_chunk_mut<const N: usize>( &mut self, ) -> Option<(&mut TypedArray<I, T, N>, &mut TypedSlice<I, T>)>

Source

pub const fn split_last_chunk<const N: usize>( &self, ) -> Option<(&TypedSlice<I, T>, &TypedArray<I, T, N>)>

Source

pub const fn split_last_chunk_mut<const N: usize>( &mut self, ) -> Option<(&mut TypedSlice<I, T>, &mut TypedArray<I, T, N>)>

Source

pub const fn last_chunk<const N: usize>(&self) -> Option<&TypedArray<I, T, N>>

Source

pub const fn last_chunk_mut<const N: usize>( &mut self, ) -> Option<&mut TypedArray<I, T, N>>

Source

pub fn get<X>(&self, index: X) -> Option<&X::Output>
where X: TypedSliceIndex<Self>,

Source

pub fn get_mut<X>(&mut self, index: X) -> Option<&mut X::Output>
where X: TypedSliceIndex<Self>,

Source

pub unsafe fn get_unchecked<X>(&self, index: X) -> &X::Output
where X: TypedSliceIndex<Self>,

§Safety

The index must be in bounds.

Source

pub unsafe fn get_unchecked_mut<X>(&mut self, index: X) -> &mut X::Output
where X: TypedSliceIndex<Self>,

§Safety

The index must be in bounds.

Source

pub const fn as_ptr(&self) -> *const T

Source

pub const fn as_mut_ptr(&mut self) -> *mut T

Source

pub const fn as_ptr_range(&self) -> Range<*const T>

Source

pub const fn as_mut_ptr_range(&mut self) -> Range<*mut T>

Source

pub const fn as_array<const N: usize>(&self) -> Option<&TypedArray<I, T, N>>

Source

pub const fn as_mut_array<const N: usize>( &mut self, ) -> Option<&mut TypedArray<I, T, N>>

Source

pub fn swap(&mut self, a: I, b: I)

Source

pub const fn reverse(&mut self)

Source

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

Source

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

Source

pub fn indices(&self) -> TypedRange<I>

Returns an iterator over the valid indices of this slice.

Source

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

Returns an iterator over the elements with their indices.

Source

pub fn iter_mut_enumerated( &mut self, ) -> UncheckedTypedEnumerate<I, IterMut<'_, T>>

Returns an iterator over the elements with their mutable references and indices.

Source

pub const unsafe fn as_chunks_unchecked<const N: usize>( &self, ) -> &TypedSlice<I, TypedArray<I, T, N>>

§Safety

See core::slice::as_chunks_unchecked.

Source

pub const fn as_chunks<const N: usize>( &self, ) -> (&TypedSlice<I, TypedArray<I, T, N>>, &TypedSlice<I, T>)

Source

pub const fn as_rchunks<const N: usize>( &self, ) -> (&TypedSlice<I, T>, &TypedSlice<I, TypedArray<I, T, N>>)

Source

pub const unsafe fn as_chunks_unchecked_mut<const N: usize>( &mut self, ) -> &mut TypedSlice<I, TypedArray<I, T, N>>

§Safety

See core::slice::as_chunks_unchecked_mut.

Source

pub const fn as_chunks_mut<const N: usize>( &mut self, ) -> (&mut TypedSlice<I, TypedArray<I, T, N>>, &mut TypedSlice<I, T>)

Source

pub const fn as_rchunks_mut<const N: usize>( &mut self, ) -> (&mut TypedSlice<I, T>, &mut TypedSlice<I, TypedArray<I, T, N>>)

Source

pub unsafe fn split_at_unchecked( &self, mid: I, ) -> (&TypedSlice<I, T>, &TypedSlice<I, T>)

§Safety

mid must be in bounds.

Source

pub unsafe fn split_at_mut_unchecked( &mut self, mid: I, ) -> (&mut TypedSlice<I, T>, &mut TypedSlice<I, T>)

§Safety

mid must be in bounds.

Source

pub fn split_at_checked( &self, mid: I, ) -> Option<(&TypedSlice<I, T>, &TypedSlice<I, T>)>

Source

pub fn split_at_mut_checked( &mut self, mid: I, ) -> Option<(&mut TypedSlice<I, T>, &mut TypedSlice<I, T>)>

Source

pub fn splitn<F>( &self, n: usize, pred: F, ) -> Map<SplitN<'_, T, F>, fn(&[T]) -> &TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn splitn_mut<F>( &mut self, n: usize, pred: F, ) -> Map<SplitNMut<'_, T, F>, fn(&mut [T]) -> &mut TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn rsplitn<F>( &self, n: usize, pred: F, ) -> Map<RSplitN<'_, T, F>, fn(&[T]) -> &TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn rsplitn_mut<F>( &mut self, n: usize, pred: F, ) -> Map<RSplitNMut<'_, T, F>, fn(&mut [T]) -> &mut TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn contains(&self, x: &T) -> bool
where T: PartialEq,

Source

pub fn binary_search_by<'a, F>(&'a self, f: F) -> Result<I, I>
where F: FnMut(&'a T) -> Ordering,

Source

pub fn binary_search_by_key<'a, B, F>(&'a self, b: &B, f: F) -> Result<I, I>
where F: FnMut(&'a T) -> B, B: Ord,

Source

pub fn sort_unstable(&mut self)
where T: Ord,

Source

pub fn sort_unstable_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Source

pub fn sort_unstable_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Source

pub fn select_nth_unstable( &mut self, index: I, ) -> (&mut TypedSlice<I, T>, &mut T, &mut TypedSlice<I, T>)
where T: Ord,

Source

pub fn select_nth_unstable_by<F>( &mut self, index: I, compare: F, ) -> (&mut TypedSlice<I, T>, &mut T, &mut TypedSlice<I, T>)
where F: FnMut(&T, &T) -> Ordering,

Source

pub fn select_nth_unstable_by_key<K, F>( &mut self, index: I, f: F, ) -> (&mut TypedSlice<I, T>, &mut T, &mut TypedSlice<I, T>)
where F: FnMut(&T) -> K, K: Ord,

Source

pub fn rotate_left(&mut self, mid: I)

Source

pub fn rotate_right(&mut self, k: I)

Source

pub fn fill(&mut self, value: T)
where T: Clone,

Source

pub fn fill_with<F>(&mut self, f: F)
where F: FnMut() -> T,

Source

pub fn copy_within<R: RangeBounds<I>>(&mut self, src: R, dest: I)
where T: Copy,

Source

pub fn is_sorted(&self) -> bool
where T: PartialOrd,

Source

pub fn is_sorted_by<'a, F>(&'a self, compare: F) -> bool
where F: FnMut(&'a T, &'a T) -> bool,

Source

pub fn is_sorted_by_key<'a, F, K>(&'a self, f: F) -> bool
where F: FnMut(&'a T) -> K, K: PartialOrd,

Source

pub fn partition_point<P>(&self, pred: P) -> I
where P: FnMut(&T) -> bool,

Source

pub fn get_disjoint_mut<X, const N: usize>( &mut self, indices: [X; N], ) -> Result<[&mut X::Output; N], GetDisjointMutError>

Source

pub unsafe fn get_disjoint_unchecked_mut<X, const N: usize>( &mut self, indices: [X; N], ) -> [&mut X::Output; N]
where X: TypedSliceIndex<Self>,

§Safety

All indices must be in bounds and non-overlapping.

Source

pub fn windows( &self, size: usize, ) -> Map<Windows<'_, T>, fn(&[T]) -> &TypedSlice<I, T>>

Source

pub fn chunks( &self, size: usize, ) -> Map<Chunks<'_, T>, fn(&[T]) -> &TypedSlice<I, T>>

Source

pub fn chunks_mut( &mut self, size: usize, ) -> Map<ChunksMut<'_, T>, fn(&mut [T]) -> &mut TypedSlice<I, T>>

Source

pub fn rchunks( &self, size: usize, ) -> Map<RChunks<'_, T>, fn(&[T]) -> &TypedSlice<I, T>>

Source

pub fn rchunks_mut( &mut self, size: usize, ) -> Map<RChunksMut<'_, T>, fn(&mut [T]) -> &mut TypedSlice<I, T>>

Source

pub fn split_at(&self, mid: I) -> (&TypedSlice<I, T>, &TypedSlice<I, T>)

Source

pub fn split_at_mut( &mut self, mid: I, ) -> (&mut TypedSlice<I, T>, &mut TypedSlice<I, T>)

Source

pub fn split<F>( &self, pred: F, ) -> Map<Split<'_, T, F>, fn(&[T]) -> &TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn split_mut<F>( &mut self, pred: F, ) -> Map<SplitMut<'_, T, F>, fn(&mut [T]) -> &mut TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn split_inclusive<F>( &self, pred: F, ) -> Map<SplitInclusive<'_, T, F>, fn(&[T]) -> &TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn split_inclusive_mut<F>( &mut self, pred: F, ) -> Map<SplitInclusiveMut<'_, T, F>, fn(&mut [T]) -> &mut TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn starts_with(&self, needle: &TypedSlice<I, T>) -> bool
where T: PartialEq,

Source

pub fn ends_with(&self, needle: &TypedSlice<I, T>) -> bool
where T: PartialEq,

Source

pub fn clone_from_slice(&mut self, src: &TypedSlice<I, T>)
where T: Clone,

Source

pub fn copy_from_slice(&mut self, src: &TypedSlice<I, T>)
where T: Copy,

Source

pub fn swap_with_slice(&mut self, other: &mut TypedSlice<I, T>)

Source

pub fn align_to<U>(&self) -> (&TypedSlice<I, T>, &[U], &TypedSlice<I, T>)

Source

pub fn align_to_mut<U>( &mut self, ) -> (&mut TypedSlice<I, T>, &mut [U], &mut TypedSlice<I, T>)

Source

pub fn chunk_by<F>( &self, pred: F, ) -> Map<ChunkBy<'_, T, F>, fn(&[T]) -> &TypedSlice<I, T>>
where F: FnMut(&T, &T) -> bool,

Source

pub fn chunk_by_mut<F>( &mut self, pred: F, ) -> Map<ChunkByMut<'_, T, F>, fn(&mut [T]) -> &mut TypedSlice<I, T>>
where F: FnMut(&T, &T) -> bool,

Source

pub fn chunks_exact( &self, chunk_size: usize, ) -> Map<ChunksExact<'_, T>, fn(&[T]) -> &TypedSlice<I, T>>

Source

pub fn chunks_exact_mut( &mut self, chunk_size: usize, ) -> Map<ChunksExactMut<'_, T>, fn(&mut [T]) -> &mut TypedSlice<I, T>>

Source

pub fn rchunks_exact( &self, chunk_size: usize, ) -> Map<RChunksExact<'_, T>, fn(&[T]) -> &TypedSlice<I, T>>

Source

pub fn rchunks_exact_mut( &mut self, chunk_size: usize, ) -> Map<RChunksExactMut<'_, T>, fn(&mut [T]) -> &mut TypedSlice<I, T>>

Source

pub fn repeat(&self, n: usize) -> Result<TypedVec<I, T>, I::IndexTooBigError>
where T: Copy,

Source

pub fn rsplit_mut<F>( &mut self, pred: F, ) -> Map<RSplitMut<'_, T, F>, fn(&mut [T]) -> &mut TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn rsplit<F>( &self, pred: F, ) -> Map<RSplit<'_, T, F>, fn(&[T]) -> &TypedSlice<I, T>>
where F: FnMut(&T) -> bool,

Source

pub fn sort(&mut self)
where T: Ord,

Source

pub fn sort_by<F>(&mut self, compare: F)
where F: FnMut(&T, &T) -> Ordering,

Source

pub fn sort_by_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Source

pub fn sort_by_cached_key<K, F>(&mut self, f: F)
where F: FnMut(&T) -> K, K: Ord,

Source

pub fn split_off_first<'a>(self: &mut &'a Self) -> Option<&'a T>

Source

pub fn split_off_first_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>

Source

pub fn split_off_last<'a>(self: &mut &'a Self) -> Option<&'a T>

Source

pub fn split_off_last_mut<'a>(self: &mut &'a mut Self) -> Option<&'a mut T>

Source

pub fn to_vec(&self) -> TypedVec<I, T>
where T: Clone,

Source§

impl<I: IndexType, T, const N: usize> TypedSlice<I, TypedArray<I, T, N>>

Source

pub fn as_flattened(&self) -> Result<&TypedSlice<I, T>, I::IndexTooBigError>

Source

pub fn as_flattened_mut( &mut self, ) -> Result<&mut TypedSlice<I, T>, I::IndexTooBigError>

Trait Implementations§

Source§

impl<I: IndexType, T, const N: usize> AsMut<TypedSlice<I, T>> for TypedArray<I, T, N>

Source§

fn as_mut(&mut self) -> &mut TypedSlice<I, T>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<I: IndexType, T, const N: usize> AsMut<TypedSlice<I, T>> for TypedArrayVec<I, T, N>

Source§

fn as_mut(&mut self) -> &mut TypedSlice<I, T>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<I: IndexType, T> AsMut<TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn as_mut(&mut self) -> &mut TypedSlice<I, T>

Converts this type into a mutable reference of the (usually inferred) input type.
Source§

impl<I: IndexType, T, const N: usize> AsRef<TypedSlice<I, T>> for TypedArray<I, T, N>

Source§

fn as_ref(&self) -> &TypedSlice<I, T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<I: IndexType, T, const N: usize> AsRef<TypedSlice<I, T>> for TypedArrayVec<I, T, N>

Source§

fn as_ref(&self) -> &TypedSlice<I, T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<I: IndexType, T> AsRef<TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn as_ref(&self) -> &TypedSlice<I, T>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<I: IndexType, T, const N: usize> Borrow<TypedSlice<I, T>> for TypedArray<I, T, N>

Source§

fn borrow(&self) -> &TypedSlice<I, T>

Immutably borrows from an owned value. Read more
Source§

impl<I: IndexType, T, const N: usize> Borrow<TypedSlice<I, T>> for TypedArrayVec<I, T, N>

Source§

fn borrow(&self) -> &TypedSlice<I, T>

Immutably borrows from an owned value. Read more
Source§

impl<I: IndexType, T> Borrow<TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn borrow(&self) -> &TypedSlice<I, T>

Immutably borrows from an owned value. Read more
Source§

impl<I: IndexType, T, const N: usize> BorrowMut<TypedSlice<I, T>> for TypedArray<I, T, N>

Source§

fn borrow_mut(&mut self) -> &mut TypedSlice<I, T>

Mutably borrows from an owned value. Read more
Source§

impl<I: IndexType, T, const N: usize> BorrowMut<TypedSlice<I, T>> for TypedArrayVec<I, T, N>

Source§

fn borrow_mut(&mut self) -> &mut TypedSlice<I, T>

Mutably borrows from an owned value. Read more
Source§

impl<I: IndexType, T> BorrowMut<TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn borrow_mut(&mut self) -> &mut TypedSlice<I, T>

Mutably borrows from an owned value. Read more
Source§

impl<I: IndexType, T: Debug> Debug for TypedSlice<I, T>

Source§

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

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

impl<'a, I: IndexType, T: Clone> From<&'a TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn from(value: &'a TypedSlice<I, T>) -> Self

Converts to this type from the input type.
Source§

impl<I: IndexType, T: Hash> Hash for TypedSlice<I, T>

Source§

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

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

impl<I: IndexType, T, X: TypedSliceIndex<TypedSlice<I, T>>> Index<X> for TypedSlice<I, T>

Source§

type Output = <X as TypedSliceIndex<TypedSlice<I, T>>>::Output

The returned type after indexing.
Source§

fn index(&self, index: X) -> &Self::Output

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

impl<I: IndexType, T, X: TypedSliceIndex<TypedSlice<I, T>>> IndexMut<X> for TypedSlice<I, T>

Source§

fn index_mut(&mut self, index: X) -> &mut Self::Output

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

impl<'a, I: IndexType, T: PartialEq> PartialEq<&'a TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn eq(&self, other: &&'a TypedSlice<I, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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<'a, I: IndexType, T: PartialEq> PartialEq<&'a mut TypedSlice<I, T>> for TypedVec<I, T>

Source§

fn eq(&self, other: &&'a mut TypedSlice<I, T>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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: IndexType, T: PartialEq> PartialEq<TypedSlice<I, T>> for TypedVec<I, T>

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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: IndexType, T: PartialEq> PartialEq for TypedSlice<I, T>

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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<'a, I: IndexType, T> TryFrom<&'a [T]> for &'a TypedSlice<I, T>

Source§

type Error = <I as IndexType>::IndexTooBigError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a [T]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, I: IndexType, T, const N: usize> TryFrom<&'a TypedSlice<I, T>> for &'a TypedArray<I, T, N>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from( slice: &'a TypedSlice<I, T>, ) -> Result<&'a TypedArray<I, T, N>, TryFromSliceError>

Performs the conversion.
Source§

impl<'a, I: IndexType, T: Copy, const N: usize> TryFrom<&'a TypedSlice<I, T>> for TypedArray<I, T, N>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from( slice: &'a TypedSlice<I, T>, ) -> Result<TypedArray<I, T, N>, TryFromSliceError>

Performs the conversion.
Source§

impl<'a, I: IndexType, T> TryFrom<&'a mut [T]> for &'a mut TypedSlice<I, T>

Source§

type Error = <I as IndexType>::IndexTooBigError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &'a mut [T]) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl<'a, I: IndexType, T, const N: usize> TryFrom<&'a mut TypedSlice<I, T>> for &'a mut TypedArray<I, T, N>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from( slice: &'a mut TypedSlice<I, T>, ) -> Result<&'a mut TypedArray<I, T, N>, TryFromSliceError>

Performs the conversion.
Source§

impl<'a, I: IndexType, T: Copy, const N: usize> TryFrom<&'a mut TypedSlice<I, T>> for TypedArray<I, T, N>

Source§

type Error = TryFromSliceError

The type returned in the event of a conversion error.
Source§

fn try_from( slice: &'a mut TypedSlice<I, T>, ) -> Result<TypedArray<I, T, N>, TryFromSliceError>

Performs the conversion.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for I

Source§

type Output = T

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&Self::Output>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut Self::Output>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const Self::Output

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut Self::Output

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &Self::Output

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut Self::Output

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for Range<I>

Source§

type Output = TypedSlice<I, T>

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&Self::Output>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut Self::Output>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const Self::Output

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut Self::Output

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &Self::Output

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut Self::Output

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for RangeFrom<I>

Source§

type Output = TypedSlice<I, T>

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&TypedSlice<I, T>>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut TypedSlice<I, T>>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const TypedSlice<I, T>

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut TypedSlice<I, T>

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &TypedSlice<I, T>

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut TypedSlice<I, T>

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for RangeFull

Source§

type Output = TypedSlice<I, T>

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&TypedSlice<I, T>>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut TypedSlice<I, T>>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const TypedSlice<I, T>

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut TypedSlice<I, T>

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &TypedSlice<I, T>

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut TypedSlice<I, T>

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for RangeInclusive<I>

Source§

type Output = TypedSlice<I, T>

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&Self::Output>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut Self::Output>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const Self::Output

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut Self::Output

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &Self::Output

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut Self::Output

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for RangeTo<I>

Source§

type Output = TypedSlice<I, T>

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&TypedSlice<I, T>>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut TypedSlice<I, T>>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const TypedSlice<I, T>

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut TypedSlice<I, T>

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &TypedSlice<I, T>

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut TypedSlice<I, T>

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T> TypedSliceIndex<TypedSlice<I, T>> for RangeToInclusive<I>

Source§

type Output = TypedSlice<I, T>

The output type of the indexing operation.
Source§

fn get(self, slice: &TypedSlice<I, T>) -> Option<&TypedSlice<I, T>>

Returns a reference to the output type, or None if out of bounds.
Source§

fn get_mut(self, slice: &mut TypedSlice<I, T>) -> Option<&mut TypedSlice<I, T>>

Returns a mutable reference to the output type, or None if out of bounds.
Source§

unsafe fn get_unchecked( self, slice: *const TypedSlice<I, T>, ) -> *const TypedSlice<I, T>

Returns a reference to the output type without bounds checking. Read more
Source§

unsafe fn get_unchecked_mut( self, slice: *mut TypedSlice<I, T>, ) -> *mut TypedSlice<I, T>

Returns a mutable reference to the output type without bounds checking. Read more
Source§

fn index(self, slice: &TypedSlice<I, T>) -> &TypedSlice<I, T>

Returns a reference to the output type, panicking if out of bounds.
Source§

fn index_mut(self, slice: &mut TypedSlice<I, T>) -> &mut TypedSlice<I, T>

Returns a mutable reference to the output type, panicking if out of bounds.
Source§

impl<I: IndexType, T: Eq> Eq for TypedSlice<I, T>

Auto Trait Implementations§

§

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

§

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

§

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

§

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

§

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

§

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

§

impl<I, T> UnsafeUnpin for TypedSlice<I, T>
where T: UnsafeUnpin,

§

impl<I, T> UnwindSafe for TypedSlice<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