[][src]Struct byte_pool::BytePool

pub struct BytePool<T = Vec<u8>> where
    T: Poolable
{ /* fields omitted */ }

A pool of byte slices, that reuses memory.

Methods

impl<T: Poolable> BytePool<T>[src]

pub fn new() -> Self[src]

Constructs a new pool.

pub fn alloc(&self, size: usize) -> Block<T>[src]

Allocates a new Block, which represents a fixed sice byte slice. If Block is dropped, the memory is not freed, but rather it is returned into the pool. The returned Block contains arbitrary data, and must be zeroed or overwritten, in cases this is needed.

Trait Implementations

impl<T: Debug> Debug for BytePool<T> where
    T: Poolable
[src]

impl<T: Poolable> Default for BytePool<T>[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for BytePool<T> where
    T: RefUnwindSafe

impl<T> Send for BytePool<T> where
    T: Send

impl<T> Sync for BytePool<T> where
    T: Send

impl<T> Unpin for BytePool<T> where
    T: Unpin

impl<T = Vec<u8>> !UnwindSafe for BytePool<T>

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.