pub struct ComponentContext { /* private fields */ }Expand description
Context handed to Component::init and propagated through dependent
components.
Implementations§
Source§impl ComponentContext
impl ComponentContext
Sourcepub fn new(shutdown: ShutdownToken) -> Self
pub fn new(shutdown: ShutdownToken) -> Self
Construct a new context with the given shutdown token.
Sourcepub fn shutdown(&self) -> ShutdownToken
pub fn shutdown(&self) -> ShutdownToken
Borrow the shutdown token. Components should select a child token for their own background tasks so that a single component’s shutdown does not implicitly trigger a registry-wide one.
Sourcepub fn child_shutdown(&self) -> ShutdownToken
pub fn child_shutdown(&self) -> ShutdownToken
Borrow a child shutdown token.
Trait Implementations§
Source§impl Clone for ComponentContext
impl Clone for ComponentContext
Source§fn clone(&self) -> ComponentContext
fn clone(&self) -> ComponentContext
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ComponentContext
impl RefUnwindSafe for ComponentContext
impl Send for ComponentContext
impl Sync for ComponentContext
impl Unpin for ComponentContext
impl UnsafeUnpin for ComponentContext
impl UnwindSafe for ComponentContext
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