pub struct OwnedEntry<T: Default> { /* private fields */ }Expand description
An owned entry in the pool.
OwnedEntry holds a reference pointer to an item from the pool and a Arc
reference to the Pool.
When the last OwnedEntry is dropped, the item is returned to the pool.
Implementations§
Source§impl<T: Default> OwnedEntry<T>
impl<T: Default> OwnedEntry<T>
Trait Implementations§
Source§impl<T: Default> Clone for OwnedEntry<T>
impl<T: Default> Clone for OwnedEntry<T>
Source§impl<T: Default> Deref for OwnedEntry<T>
impl<T: Default> Deref for OwnedEntry<T>
Source§impl<T: Default> Drop for OwnedEntry<T>
impl<T: Default> Drop for OwnedEntry<T>
Source§impl<T: Default + Ord> Ord for OwnedEntry<T>
impl<T: Default + Ord> Ord for OwnedEntry<T>
Source§fn cmp(&self, other: &Self) -> Ordering
fn cmp(&self, other: &Self) -> Ordering
Comparison for two OwnedEntry
§Example
use concurrent_pool::Pool;
use std::sync::Arc;
let pool = Arc::new(Pool::<usize>::with_capacity(2));
let item1 = pool.pull_owned_with(|i| *i = 1).unwrap();
let item2 = pool.pull_owned_with(|i| *i = 2).unwrap();
assert!(item1 < item2);1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T: Default + PartialOrd> PartialOrd for OwnedEntry<T>
impl<T: Default + PartialOrd> PartialOrd for OwnedEntry<T>
impl<T: Default + Eq> Eq for OwnedEntry<T>
Auto Trait Implementations§
impl<T> Freeze for OwnedEntry<T>
impl<T> RefUnwindSafe for OwnedEntry<T>where
T: RefUnwindSafe,
impl<T> Send for OwnedEntry<T>
impl<T> Sync for OwnedEntry<T>
impl<T> Unpin for OwnedEntry<T>
impl<T> UnwindSafe for OwnedEntry<T>where
T: RefUnwindSafe,
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