[][src]Struct len_constraints::slice::Fixed

pub struct Fixed<'a, T, Val: TypeNum> { /* fields omitted */ }

An immutable slice with a fixed length as length constraint

Methods

impl<'a, T, Val: TypeNum> Fixed<'a, T, Val>[src]

pub fn len(&self) -> usize[src]

The length of the constrained slice

pub fn slice(&self) -> &[T][src]

The constrained slice

Trait Implementations

impl<'a, T, Val: TypeNum> AsRef<[T]> for Fixed<'a, T, Val>[src]

impl<'a, T: Clone, Val: Clone + TypeNum> Clone for Fixed<'a, T, Val>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a, T: Copy, Val: Copy + TypeNum> Copy for Fixed<'a, T, Val>[src]

impl<'a, T, Val: TypeNum> Into<&'a [T]> for Fixed<'a, T, Val>[src]

impl<'a, T, Val: TypeNum> Deref for Fixed<'a, T, Val>[src]

type Target = [T]

The resulting type after dereferencing.

impl<'a, T: Debug, Val: Debug + TypeNum> Debug for Fixed<'a, T, Val>[src]

impl<'a, T, Val: TypeNum> TryFrom<&'a [T]> for Fixed<'a, T, Val>[src]

type Error = Box<dyn Error + 'static>

The type returned in the event of a conversion error.

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

Validates slice against the length constraint and creates the constrained slice with it

impl<'a, T, Val: TypeNum, I: SliceIndex<[T]>> Index<I> for Fixed<'a, T, Val>[src]

type Output = I::Output

The returned type after indexing.

Auto Trait Implementations

impl<'a, T, Val> Send for Fixed<'a, T, Val> where
    T: Sync,
    Val: Send

impl<'a, T, Val> Sync for Fixed<'a, T, Val> where
    T: Sync,
    Val: Sync

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]