pub struct OpenAndCompactCancellationToken { /* private fields */ }Expand description
A flag that aborts an open_and_compact_with_options call from another
thread.
Create one, hand it to OpenAndCompactOptions::set_canceled, keep a clone
of the Arc somewhere else, and call cancel from that
other thread. Cancellation is one shot and best effort. The compaction
iterator checks the flag as it walks the input, so the job stops at the next
check rather than immediately.
There is no C API to read the flag back, so this is write only and there is no way to un-cancel. Use a fresh token per call.
Implementations§
Source§impl OpenAndCompactCancellationToken
impl OpenAndCompactCancellationToken
Sourcepub fn cancel(&self)
pub fn cancel(&self)
Signals that the compaction using this token should stop.
Returns as soon as the flag is stored. The compaction winds down on its
own thread and the open_and_compact_with_options call it belongs to
then fails.
Trait Implementations§
impl Send for OpenAndCompactCancellationToken
impl Sync for OpenAndCompactCancellationToken
Auto Trait Implementations§
impl Freeze for OpenAndCompactCancellationToken
impl RefUnwindSafe for OpenAndCompactCancellationToken
impl Unpin for OpenAndCompactCancellationToken
impl UnsafeUnpin for OpenAndCompactCancellationToken
impl UnwindSafe for OpenAndCompactCancellationToken
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