pub struct UnboundObjectPoolRef<T: Send> { /* private fields */ }Expand description
One item borrowed from an UnboundObjectPool — Deref/DerefMut
to T for normal use, and returns itself to the pool (after running
release on it) when dropped.
Meant to be wrapped in an Arc wherever it needs to be shared/cloned
downstream (see crate::buffer::MediaBuffer::Video) — cloning the
Arc is what lets e.g. crate::elements::Tee fan the same frame
out to multiple branches cheaply, and the item only actually goes
back to the pool once every one of those clones has been dropped.
This type itself is deliberately not Clone: only one thing can
hold the actual boxed value at a time, or “return it once the last
reference drops” wouldn’t mean anything.
Trait Implementations§
Source§impl<T: Send> Deref for UnboundObjectPoolRef<T>
impl<T: Send> Deref for UnboundObjectPoolRef<T>
Source§impl<T: Send> DerefMut for UnboundObjectPoolRef<T>
impl<T: Send> DerefMut for UnboundObjectPoolRef<T>
Source§impl<T: Send> Drop for UnboundObjectPoolRef<T>
impl<T: Send> Drop for UnboundObjectPoolRef<T>
Auto Trait Implementations§
impl<T> !RefUnwindSafe for UnboundObjectPoolRef<T>
impl<T> !UnwindSafe for UnboundObjectPoolRef<T>
impl<T> Freeze for UnboundObjectPoolRef<T>
impl<T> Send for UnboundObjectPoolRef<T>
impl<T> Sync for UnboundObjectPoolRef<T>where
T: Sync,
impl<T> Unpin for UnboundObjectPoolRef<T>
impl<T> UnsafeUnpin for UnboundObjectPoolRef<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
Source§impl<T, A> DynAccess<T> for A
impl<T, A> DynAccess<T> for A
Source§fn load(&self) -> DynGuard<T>
fn load(&self) -> DynGuard<T>
The equivalent of
Access::load.