pub struct Context { /* private fields */ }
Expand description
A context for cancelling futures and waiting for shutdown
A context can be created from a handler or another context so to have a hierarchy of contexts
Contexts can then be attached to futures or streams in order to
automatically cancel them when the context is done, when invoking
Handler::cancel
. The Handler::shutdown
method will block until all
contexts have been dropped allowing for a graceful shutdown.
Implementations§
Trait Implementations§
Source§impl<'a> From<&'a Context> for ContextRef<'a>
impl<'a> From<&'a Context> for ContextRef<'a>
Auto Trait Implementations§
impl Freeze for Context
impl RefUnwindSafe for Context
impl Send for Context
impl Sync for Context
impl Unpin for Context
impl UnwindSafe for Context
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