pub struct Pooled<T: Poolable + Send + 'static> { /* private fields */ }Expand description
A generic wrapper for pooled objects. This handles keeping track of the pool pointer for you and allows you to wrap almost any container type easily.
Most of the time, this is what you want to use.
Implementations§
Source§impl<T: Poolable + Send + 'static> Pooled<T>
impl<T: Poolable + Send + 'static> Pooled<T>
Sourcepub fn orphan(t: T) -> Self
pub fn orphan(t: T) -> Self
Creates a Pooled that isn’t connected to any pool. E.G. for
branches where you know a given Pooled will always be empty.
Trait Implementations§
Source§impl<'de, T: Poolable + Send + 'static + DeserializeOwned> Deserialize<'de> for Pooled<T>
impl<'de, T: Poolable + Send + 'static + DeserializeOwned> Deserialize<'de> for Pooled<T>
Source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<T: Poolable + Send + 'static + Ord> Ord for Pooled<T>
impl<T: Poolable + Send + 'static + Ord> Ord for Pooled<T>
Source§impl<T: Poolable + Send + 'static + PartialOrd> PartialOrd for Pooled<T>
impl<T: Poolable + Send + 'static + PartialOrd> PartialOrd for Pooled<T>
Source§impl<T: Poolable + Send + 'static> RawPoolable for Pooled<T>
impl<T: Poolable + Send + 'static> RawPoolable for Pooled<T>
Source§fn empty(pool: WeakPool<Self>) -> Self
fn empty(pool: WeakPool<Self>) -> Self
allocate a new empty object and set it’s pool pointer to
poolSource§fn reset(&mut self)
fn reset(&mut self)
empty the collection and reset it to it’s default state so it
can be put back in the pool
Source§fn really_drop(self)
fn really_drop(self)
Actually drop the inner object, don’t put it back in the pool,
make sure you do not call both this method and the drop
implementation that puts the object back in the pool!
impl<T: Poolable + Send + 'static + Eq> Eq for Pooled<T>
Auto Trait Implementations§
impl<T> Freeze for Pooled<T>where
T: Freeze,
impl<T> RefUnwindSafe for Pooled<T>where
T: RefUnwindSafe,
impl<T> Send for Pooled<T>
impl<T> Sync for Pooled<T>where
T: Sync,
impl<T> Unpin for Pooled<T>where
T: Unpin,
impl<T> UnwindSafe for Pooled<T>where
T: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.