#[repr(u8)]pub enum ExecutionContext {
Shadow = 0,
Application = 1,
}
Expand description
Values of this enum describes whether something occurred within the context of the shadow (shim) code, or the application/plugin code.
Methods of this enum interact with a private thread-local that tracks the
current ExecutionContext
for that thread.
Variants§
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
Sourcepub fn current() -> ExecutionContext
pub fn current() -> ExecutionContext
Returns the current context for the current thread.
Sourcepub fn enter(&self) -> ExecutionContextRestorer
pub fn enter(&self) -> ExecutionContextRestorer
Enter this context for the current thread, and return a restorer that will restore the previous context when dropped.
Sourcepub fn enter_without_restorer(&self) -> ExecutionContext
pub fn enter_without_restorer(&self) -> ExecutionContext
Enter this context for the current thread, without creating a restorer. Returns the previous context.
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for ExecutionContext
impl Debug for ExecutionContext
Source§impl From<ExecutionContext> for u8
impl From<ExecutionContext> for u8
Source§fn from(enum_value: ExecutionContext) -> Self
fn from(enum_value: ExecutionContext) -> Self
Converts to this type from the input type.
Source§impl PartialEq for ExecutionContext
impl PartialEq for ExecutionContext
Source§impl TryFrom<u8> for ExecutionContext
impl TryFrom<u8> for ExecutionContext
Source§type Error = TryFromPrimitiveError<ExecutionContext>
type Error = TryFromPrimitiveError<ExecutionContext>
The type returned in the event of a conversion error.
Source§impl TryFromPrimitive for ExecutionContext
impl TryFromPrimitive for ExecutionContext
const NAME: &'static str = "ExecutionContext"
type Primitive = u8
type Error = TryFromPrimitiveError<ExecutionContext>
fn try_from_primitive( number: Self::Primitive, ) -> Result<Self, TryFromPrimitiveError<Self>>
impl Copy for ExecutionContext
impl Eq for ExecutionContext
impl StructuralPartialEq for ExecutionContext
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnwindSafe for ExecutionContext
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