[go: up one dir, main page]

[][src]Struct byte_pool::Block

pub struct Block<'a, T: Poolable = Vec<u8>> { /* fields omitted */ }

The value returned by an allocation of the pool. When it is dropped the memory gets returned into the pool, and is not zeroed. If that is a concern, you must clear the data yourself.

Methods

impl<'a, T: Poolable> Block<'a, T>[src]

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

Returns the amount of bytes this block has.

impl<'a, T: Poolable + Realloc> Block<'a, T>[src]

pub fn realloc(&mut self, new_size: usize)[src]

Resizes a block to a new size.

Trait Implementations

impl<'_, T: Poolable + Debug> Debug for Block<'_, T>[src]

impl<'a, T: Poolable> Deref for Block<'a, T>[src]

type Target = T

The resulting type after dereferencing.

impl<'a, T: Poolable> DerefMut for Block<'a, T>[src]

impl<'a, T: Poolable> Drop for Block<'a, T>[src]

impl<'a, T: StableDeref + Poolable> StableDeref for Block<'a, T>[src]

Auto Trait Implementations

impl<'a, T> RefUnwindSafe for Block<'a, T> where
    T: RefUnwindSafe

impl<'a, T> Send for Block<'a, T> where
    T: Send

impl<'a, T> Sync for Block<'a, T> where
    T: Send + Sync

impl<'a, T> Unpin for Block<'a, T> where
    T: Unpin

impl<'a, T> UnwindSafe for Block<'a, T> where
    T: RefUnwindSafe + 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 = !

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.