Poolable

Trait Poolable 

Source
pub trait Poolable {
    // Required methods
    fn empty() -> Self;
    fn reset(&mut self);
    fn capacity(&self) -> usize;

    // Provided method
    fn really_dropped(&self) -> bool { ... }
}

Required Methods§

Source

fn empty() -> Self

Source

fn reset(&mut self)

Source

fn capacity(&self) -> usize

Provided Methods§

Source

fn really_dropped(&self) -> bool

in case you are pooling something ref counted e.g. arc

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl Poolable for String

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn capacity(&self) -> usize

Source§

impl<K, R> Poolable for HashSet<K, R>
where K: Hash + Eq, R: Default + BuildHasher,

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn capacity(&self) -> usize

Source§

impl<K, V, R> Poolable for HashMap<K, V, R>
where K: Hash + Eq, R: Default + BuildHasher,

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn capacity(&self) -> usize

Source§

impl<T> Poolable for VecDeque<T>

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn capacity(&self) -> usize

Source§

impl<T> Poolable for Vec<T>

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn capacity(&self) -> usize

Source§

impl<T: Poolable> Poolable for Arc<T>

Source§

fn empty() -> Self

Source§

fn reset(&mut self)

Source§

fn capacity(&self) -> usize

Source§

fn really_dropped(&self) -> bool

Implementors§