Struct poison_pool::Item
[−]
[src]
pub struct Item<T> {
// some fields omitted
}An element that logically came from a PoisonPool.
If this item came from PoisonPool::get*(), then when this Item is
Dropped, it will be recycled into the pool.
If this item came from the from_value constructor, then when this Item is
Dropped, the contained value will be dropped as well.
Methods
impl<T> Item<T>
fn from_value(value: T) -> Item<T>
Directly construct an Item. When this Item is dropped, it will not be returned to any Pool.
fn replace(&mut self, new: T) -> T
Replaces the value of the item with another one.
fn poison(self)
Poisons this value.
Even when this item is returned to the pool, this item will not be
used until unpoison_all is called on the owning pool.