pub struct CancellationToken(/* private fields */);Expand description
Cancellation of a single operation. Connect transport cancellation here; stopping polling alone does not stop browser Fetch or undo a server operation.
Implementations§
Source§impl CancellationToken
impl CancellationToken
pub fn is_cancelled(&self) -> bool
pub fn on_cancel(&self, callback: impl FnOnce() + 'static) -> CancelRegistration
Sourcepub fn abort_signal(&self) -> Result<AbortSignal, JsValue>
pub fn abort_signal(&self) -> Result<AbortSignal, JsValue>
A browser AbortSignal that aborts when this token is cancelled. Pass it to
any Fetch; it lives as long as the token, so it also covers body reads.
Trait Implementations§
Source§impl Clone for CancellationToken
impl Clone for CancellationToken
Auto Trait Implementations§
impl !RefUnwindSafe for CancellationToken
impl !Send for CancellationToken
impl !Sync for CancellationToken
impl !UnwindSafe for CancellationToken
impl Freeze for CancellationToken
impl Unpin for CancellationToken
impl UnsafeUnpin for CancellationToken
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