[][src]Struct index_ext::tag::Boxed

pub struct Boxed<T, Tag> { /* fields omitted */ }

An owned, allocated slice with a checked length.

Implementations

impl<T: Tag, E> Boxed<E, T>[src]

pub fn new(inner: Box<[E]>, len: ExactSize<T>) -> Result<Self, Box<[E]>>[src]

Try to construct an asserted box, returning it on error.

pub fn as_ref(&self) -> Ref<'_, E, T>[src]

Reference the contents as an asserted Ref slice.

pub fn as_mut(&mut self) -> Mut<'_, E, T>[src]

Reference the contents as an asserted mutable Mut slice.

pub fn get_safe<I: SliceIndex<[E]>>(&self, index: Idx<I, T>) -> &I::Output[src]

Index the boxed slice unchecked but soundly.

pub fn get_safe_mut<I: SliceIndex<[E]>>(
    &mut self,
    index: Idx<I, T>
) -> &mut I::Output
[src]

Mutably index the boxed slice unchecked but soundly.

pub fn into_inner(self) -> Box<[E]>[src]

Unwrap the inner box, dropping all assertions of safe indexing.

Auto Trait Implementations

impl<T, Tag> Send for Boxed<T, Tag> where
    T: Send,
    Tag: Send

impl<T, Tag> Sync for Boxed<T, Tag> where
    T: Sync,
    Tag: Sync

impl<T, Tag> Unpin for Boxed<T, Tag> where
    Tag: Unpin

Blanket Implementations

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

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

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

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

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

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.