pub struct HookContextCell(/* private fields */);Expand description
A Sync wrapper for single-threaded global HookContextInner access.
SAFETY: This type is only safe to use in single-threaded contexts
(e.g., WASM). It implements Sync to allow usage as a static
variable, but concurrent access from multiple threads would be
undefined behavior.
Implementations§
Source§impl HookContextCell
Implementation of HookContextCell construction and access.
impl HookContextCell
Implementation of HookContextCell construction and access.
Sourcepub const fn get_inner(&self) -> &'static mut HookContextInner
pub const fn get_inner(&self) -> &'static mut HookContextInner
Returns a mutable reference to the inner HookContextInner.
§Returns
&'static mut HookContextInner- A mutable reference to the inner state.
Trait Implementations§
Source§impl Debug for HookContextCell
impl Debug for HookContextCell
impl Sync for HookContextCell
SAFETY: HookContextCell is only used in single-threaded WASM contexts.
Concurrent access from multiple threads would be undefined behavior.
Auto Trait Implementations§
impl !Freeze for HookContextCell
impl !RefUnwindSafe for HookContextCell
impl !Send for HookContextCell
impl Unpin for HookContextCell
impl UnsafeUnpin for HookContextCell
impl !UnwindSafe for HookContextCell
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