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>
impl<T: Tag, E> Boxed<E, T>
sourcepub fn new(inner: Box<[E]>, len: ExactSize<T>) -> Result<Self, Box<[E]>>
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.
sourcepub fn as_mut(&mut self) -> &mut Slice<E, T>
pub fn as_mut(&mut self) -> &mut Slice<E, T>
Reference the contents as an asserted mutable Slice
.
sourcepub fn capacity(&self) -> Capacity<T>
pub fn capacity(&self) -> Capacity<T>
Get the length as a Capacity
of all slices with this tag.
sourcepub fn get_safe<I: SliceIndex<[E]>>(&self, index: Idx<I, T>) -> &I::Output
pub fn get_safe<I: SliceIndex<[E]>>(&self, index: Idx<I, T>) -> &I::Output
Index the boxed slice unchecked but soundly.
sourcepub fn get_safe_mut<I: SliceIndex<[E]>>(
&mut self,
index: Idx<I, T>
) -> &mut I::Output
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.
sourcepub fn into_inner(self) -> Box<[E]>
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>where
T: RefUnwindSafe,
Tag: RefUnwindSafe,
impl<T, Tag> Send for Boxed<T, Tag>
impl<T, Tag> Sync for Boxed<T, Tag>
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> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more