pub struct ThreadScope { /* private fields */ }
Expand description
Additional metadata and state for a specific thread.
You can think of a ThreadScope
as a handle a thread has on itself.
Each ThreadScope
is an interface to advanced theard API below.
Implementations§
Source§impl ThreadScope
impl ThreadScope
Sourcepub fn activity<S: Into<String>>(&self, activity: S)
pub fn activity<S: Into<String>>(&self, activity: S)
Report the current thread activity.
This information will become accessible from the introspection API. The main use case is to aid application end users monitor, debug, and understand complex software they use and operate but not implement.
Sourcepub fn scoped_activity<S: Into<String>>(
&self,
activity: S,
) -> ThreadScopeActivityGuard
pub fn scoped_activity<S: Into<String>>( &self, activity: S, ) -> ThreadScopeActivityGuard
Report the given activity for the duration of a scope.
The scope is considered over once the returned ThreadScopeActivityGuard
is dropped.
Sourcepub fn should_shutdown(&self) -> bool
pub fn should_shutdown(&self) -> bool
Check if the thread was requested to shutdown.
Auto Trait Implementations§
impl Freeze for ThreadScope
impl RefUnwindSafe for ThreadScope
impl Send for ThreadScope
impl Sync for ThreadScope
impl Unpin for ThreadScope
impl UnwindSafe for ThreadScope
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