#[non_exhaustive]pub enum ScopeKind {
Sync,
Async,
}Expand description
How a measured scope relates to the thread that entered it.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Sync
A sync function body. exit runs on the thread that called enter
and sync scopes on one thread are strictly nested (LIFO).
Async
An async fn, a measure_block! or the #[hotpath::main] wrapper.
The scope may suspend across .await points, so exit can run on
another thread and interleave with other scopes; use the token returned
by enter to pair the two calls.
Trait Implementations§
impl Copy for ScopeKind
impl Eq for ScopeKind
impl StructuralPartialEq for ScopeKind
Auto Trait Implementations§
impl Forget for ScopeKind
impl Freeze for ScopeKind
impl Move for ScopeKind
impl RefUnwindSafe for ScopeKind
impl Send for ScopeKind
impl Sync for ScopeKind
impl Unpin for ScopeKind
impl UnsafeUnpin for ScopeKind
impl UnwindSafe for ScopeKind
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