[−][src]Struct byte_pool::BytePool
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]
T: Poolable,
impl<T: Poolable> Default for BytePool<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for BytePool<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for BytePool<T> where
T: Send,
T: Send,
impl<T> Sync for BytePool<T> where
T: Send,
T: Send,
impl<T> Unpin for BytePool<T> where
T: Unpin,
T: Unpin,
impl<T = Vec<u8>> !UnwindSafe for BytePool<T>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = !
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,