Reuse

Trait Reuse 

Source
pub trait Reuse {
    // Required methods
    fn reuse(&mut self, trim: usize) -> bool;
    fn capacity(&self) -> usize;
}
Expand description

A trait that prepares an item to be returned to the pool. For example clearing it. true is returned if the item should be returned to the pool, false if it should be dropped.

Required Methods§

Source

fn reuse(&mut self, trim: usize) -> bool

Source

fn capacity(&self) -> usize

Returns the capacity of the object in bytes, to allow for more precise tracking.

Implementations on Foreign Types§

Source§

impl Reuse for VecDeque<u8>

Source§

fn reuse(&mut self, val: usize) -> bool

Source§

fn capacity(&self) -> usize

Source§

impl Reuse for Vec<u8>

Source§

fn reuse(&mut self, trim: usize) -> bool

Source§

fn capacity(&self) -> usize

Implementors§