pub struct PoolBox<T> { /* private fields */ }Expand description
A pointer to T in Pool
PoolBox implements DerefMut so it is directly mutable
(without mutex or other synchronization methods).
It is not clonable and cannot be sent to others threads.
let pool = Pool::new();
let mut my_opt: PoolBox<Option<i32>> = pool.alloc(Some(10));
assert!(my_opt.is_some());
assert_eq!(my_opt.take(), Some(10));
assert!(my_opt.is_none());Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for PoolBox<T>
impl<T> !RefUnwindSafe for PoolBox<T>
impl<T> !Send for PoolBox<T>
impl<T> !Sync for PoolBox<T>
impl<T> Unpin for PoolBox<T>
impl<T> !UnwindSafe for PoolBox<T>
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