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§
Sourcefn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
Put a new id into the pool
Sourcefn remove(&self) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Take an id out of the pool
Implementations on Foreign Types§
Source§impl<A: ScalarAllocator> Pool<A> for ()
impl<A: ScalarAllocator> Pool<A> for ()
fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
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.
impl<A: ScalarAllocator, P: Pool<A>, F: FnOnce() -> P> Pool<A> for Lazy<P, F>
Available on crate feature
once_cell only.fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
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.
impl<A: ScalarAllocator, P: Pool<A>, F: FnOnce() -> P> Pool<A> for Lazy<P, F>
Available on crate feature
once_cell only.fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Source§impl<A: ScalarAllocator, P: PoolMut<A>> Pool<A> for Mutex<P>
Available on crate feature std only.
impl<A: ScalarAllocator, P: PoolMut<A>> Pool<A> for Mutex<P>
Available on crate feature
std only.fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
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.
impl<A: ScalarAllocator, P: PoolMut<A>> Pool<A> for Mutex<P>
Available on crate feature
parking_lot only.fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Source§impl<A: ScalarAllocator, T: Default + PoolMut<A>> Pool<A> for Cell<T>
impl<A: ScalarAllocator, T: Default + PoolMut<A>> Pool<A> for Cell<T>
fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Source§impl<A: ScalarAllocator, T: PoolMut<A>> Pool<A> for RefCell<T>
impl<A: ScalarAllocator, T: PoolMut<A>> Pool<A> for RefCell<T>
fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Source§impl<P: ?Sized + Pool<A>, A: ScalarAllocator> Pool<A> for &P
impl<P: ?Sized + Pool<A>, A: ScalarAllocator> Pool<A> for &P
fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Source§impl<P: ?Sized + Pool<A>, A: ScalarAllocator> Pool<A> for &mut P
impl<P: ?Sized + Pool<A>, A: ScalarAllocator> Pool<A> for &mut P
fn insert(&self, scalar: OpaqueScalar<A>) -> Option<OpaqueScalar<A>>
fn remove(&self) -> Option<OpaqueScalar<A>>
Implementors§
impl<A: ScalarAllocator> Pool<A> for SyncQueuePool<A>
Available on crate features
parking_lot or std only.impl<A: ScalarAllocator> Pool<A> for SyncStackPool<A>
Available on crate features
parking_lot or std only.