pub struct V2Context { /* private fields */ }Expand description
A cancellation context. V2Context::background is never done.
Implementations§
Source§impl V2Context
impl V2Context
Sourcepub fn background() -> Self
pub fn background() -> Self
A context that is never cancelled.
Sourcepub fn with_cancel(&self) -> (V2Context, V2CancelHandle)
pub fn with_cancel(&self) -> (V2Context, V2CancelHandle)
A child context cancelled by the returned handle or by this context.
Sourcepub fn with_timeout(&self, timeout: Duration) -> (V2Context, V2CancelHandle)
pub fn with_timeout(&self, timeout: Duration) -> (V2Context, V2CancelHandle)
A child context that is also done once timeout has elapsed.
Trait Implementations§
Auto Trait Implementations§
impl Forget for V2Context
impl Freeze for V2Context
impl RefUnwindSafe for V2Context
impl Send for V2Context
impl Sync for V2Context
impl Unpin for V2Context
impl UnsafeUnpin for V2Context
impl UnwindSafe for V2Context
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