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

Object Safety§

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, R> Poolable for IndexSet<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<K, V, R> Poolable for IndexMap<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§