Struct checked_array::Preallocated[][src]

pub struct Preallocated<Buffer> { /* fields omitted */ }

A wrapper that implements CanAlloc over a preallocated buffer

Implementations

impl<Buffer> Preallocated<Buffer>[src]

pub const fn new(buffer: Buffer) -> Self[src]

Create a new Preallocated instance by wrapping buffer

pub const fn new_with_used(buffer: Buffer, used: usize) -> Self[src]

Create a new Preallocated instance by wrapping buffer and sets the amount of used bytes to used

Discussion: If used is greated than buffer.len(), it will be silently capped to buffer.len() wherever necessary

pub fn into_inner(self) -> Buffer[src]

Returns the wrapped buffer

Trait Implementations

impl<Buffer, T> AsMut<[T]> for Preallocated<Buffer> where
    Buffer: AsMut<[T]>, 
[src]

impl<Buffer, T> AsRef<[T]> for Preallocated<Buffer> where
    Buffer: AsRef<[T]>, 
[src]

Auto Trait Implementations

impl<Buffer> RefUnwindSafe for Preallocated<Buffer> where
    Buffer: RefUnwindSafe

impl<Buffer> Send for Preallocated<Buffer> where
    Buffer: Send

impl<Buffer> Sync for Preallocated<Buffer> where
    Buffer: Sync

impl<Buffer> Unpin for Preallocated<Buffer> where
    Buffer: Unpin

impl<Buffer> UnwindSafe for Preallocated<Buffer> where
    Buffer: UnwindSafe

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.