Pool

Trait Pool 

Source
pub trait Pool<A: ScalarAllocator>: PoolMut<A> {
    // Required methods
    fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>;
    fn remove(&self) -> Option<OpaqueScalar<A>>;
}
Expand description

A pool of ids that can be used to reuse ids in Dynamic.

Required Methods§

Source

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Put a new id into the pool

Source

fn remove(&self) -> Option<OpaqueScalar<A>>

Take an id out of the pool

Implementations on Foreign Types§

Source§

impl<A: ScalarAllocator> Pool<A> for ()

Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<A: ScalarAllocator, P: Pool<A>, F: FnOnce() -> P> Pool<A> for Lazy<P, F>

Available on crate feature once_cell only.
Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<A: ScalarAllocator, P: Pool<A>, F: FnOnce() -> P> Pool<A> for Lazy<P, F>

Available on crate feature once_cell only.
Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<A: ScalarAllocator, P: PoolMut<A>> Pool<A> for Mutex<P>

Available on crate feature std only.
Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<A: ScalarAllocator, P: PoolMut<A>> Pool<A> for Mutex<P>

Available on crate feature parking_lot only.
Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<A: ScalarAllocator, T: Default + PoolMut<A>> Pool<A> for Cell<T>

Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<A: ScalarAllocator, T: PoolMut<A>> Pool<A> for RefCell<T>

Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<P: ?Sized + Pool<A>, A: ScalarAllocator> Pool<A> for &P

Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Source§

impl<P: ?Sized + Pool<A>, A: ScalarAllocator> Pool<A> for &mut P

Source§

fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>

Source§

fn remove(&self) -> Option<OpaqueScalar<A>>

Implementors§

Source§

impl<A: ScalarAllocator> Pool<A> for SyncQueuePool<A>

Available on crate features parking_lot or std only.
Source§

impl<A: ScalarAllocator> Pool<A> for SyncStackPool<A>

Available on crate features parking_lot or std only.
Source§

impl<A: ScalarAllocator<Scalar = ()>> Pool<A> for Flag<A>

Source§

impl<A: ScalarAllocator, R: Radium<Item = usize>, P: Pool<A>> Pool<A> for Sequence<R, [P]>