pub struct FfiCancellationToken { /* private fields */ }Expand description
FFI-safe cancellation token.
This token holds a reference to the shared cancellation state.
It must be explicitly destroyed with enough_token_destroy.
The token remains valid even after the source is destroyed - it will just never become cancelled.
Implementations§
Source§impl FfiCancellationToken
impl FfiCancellationToken
Sourcepub fn never() -> Self
pub fn never() -> Self
Create a “never cancelled” token.
This token will never report as cancelled.
Sourcepub unsafe fn from_ptr(
ptr: *const FfiCancellationToken,
) -> FfiCancellationTokenView
pub unsafe fn from_ptr( ptr: *const FfiCancellationToken, ) -> FfiCancellationTokenView
Create a token view from a raw pointer.
This creates a non-owning view that can be used to check cancellation. The original token must remain valid for the lifetime of this view.
§Safety
- If
ptris non-null, it must point to a validFfiCancellationToken - The pointed-to token must outlive all uses of the returned view
Trait Implementations§
Source§impl Debug for FfiCancellationToken
impl Debug for FfiCancellationToken
Auto Trait Implementations§
impl Freeze for FfiCancellationToken
impl RefUnwindSafe for FfiCancellationToken
impl Send for FfiCancellationToken
impl Sync for FfiCancellationToken
impl Unpin for FfiCancellationToken
impl UnwindSafe for FfiCancellationToken
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