Struct index_ext::tag::Boxed

source ·
pub struct Boxed<T, Tag> { /* private fields */ }
Expand description

An owned, allocated slice with a checked length.

Implementations§

source§

impl<T: Tag, E> Boxed<E, T>

source

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

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

The box slice must have exactly the length indicated.

source

pub fn as_ref(&self) -> &Slice<E, T>

Reference the contents as an asserted Slice.

source

pub fn as_mut(&mut self) -> &mut Slice<E, T>

Reference the contents as an asserted mutable Slice.

source

pub fn capacity(&self) -> Capacity<T>

Get the length as a Capacity of all slices with this tag.

source

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

Index the boxed slice unchecked but soundly.

source

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

Mutably index the boxed slice unchecked but soundly.

source

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

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

Auto Trait Implementations§

§

impl<T, Tag> RefUnwindSafe for Boxed<T, Tag>

§

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,

§

impl<T, Tag> UnwindSafe for Boxed<T, Tag>
where T: UnwindSafe, Tag: 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<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.