pub struct CancellationToken { /* private fields */ }Expand description
Cloneable cooperative-cancellation signal shared with provider futures.
Cancellation never terminates a process by itself. Implementations must check the token at bounded intervals and perform their own process-tree or network-request cleanup.
Implementations§
Source§impl CancellationToken
impl CancellationToken
Sourcepub fn is_cancelled(&self) -> bool
pub fn is_cancelled(&self) -> bool
Whether cancellation has been requested.
Sourcepub fn check(&self) -> RemoteBuildResult<()>
pub fn check(&self) -> RemoteBuildResult<()>
Return a typed cancellation error after a request.
§Errors
Returns RemoteBuildError::Cancelled after cancellation is requested.
Trait Implementations§
Source§impl Clone for CancellationToken
impl Clone for CancellationToken
Source§impl Debug for CancellationToken
impl Debug for CancellationToken
Auto Trait Implementations§
impl Freeze for CancellationToken
impl RefUnwindSafe for CancellationToken
impl Send for CancellationToken
impl Sync for CancellationToken
impl Unpin for CancellationToken
impl UnsafeUnpin for CancellationToken
impl UnwindSafe 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