pub struct DropHandle { /* private fields */ }Expand description
A cloneable handle for deferring expensive drops to the background thread.
When all handles are dropped, the background thread’s channel closes and it exits cleanly.
Implementations§
Source§impl DropHandle
impl DropHandle
Sourcepub fn spawn() -> Self
pub fn spawn() -> Self
Spawns the background drop thread and returns a handle.
If the thread fails to spawn (resource exhaustion), logs a warning
and returns a handle that drops everything inline. The channel
disconnects immediately since the receiver is never started, and
try_send gracefully falls back to inline dropping.
Sourcepub fn defer_value(&self, value: Value)
pub fn defer_value(&self, value: Value)
Defers dropping a value to the background thread if it’s large enough to be worth the channel overhead. Small values are dropped inline.
If the channel is full, falls back to inline drop — never blocks.
Trait Implementations§
Source§impl Clone for DropHandle
impl Clone for DropHandle
Source§fn clone(&self) -> DropHandle
fn clone(&self) -> DropHandle
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for DropHandle
impl RefUnwindSafe for DropHandle
impl Send for DropHandle
impl Sync for DropHandle
impl Unpin for DropHandle
impl UnsafeUnpin for DropHandle
impl UnwindSafe for DropHandle
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