pub struct HookContextInner { /* private fields */ }Expand description
Internal storage for hook state, holding boxed Any values.
This struct is not exposed directly; use HookContext instead.
The arm_changed flag tracks whether a match arm switch occurred;
when toggled, the hook array is cleared to prevent signal leakage
between different match arms.
Implementations§
Source§impl HookContextInner
Implementation of HookContextInner construction.
impl HookContextInner
Implementation of HookContextInner construction.
Source§impl HookContextInner
impl HookContextInner
pub fn get_hooks(&self) -> &Vec<Box<dyn Any>>
pub fn get_mut_hooks(&mut self) -> &mut Vec<Box<dyn Any>>
pub fn set_hooks(&mut self, val: Vec<Box<dyn Any>>) -> &mut Self
pub fn get_arm_changed(&self) -> bool
pub fn get_mut_arm_changed(&mut self) -> &mut bool
pub fn set_arm_changed(&mut self, val: bool) -> &mut Self
pub fn get_hook_index(&self) -> usize
pub fn get_mut_hook_index(&mut self) -> &mut usize
pub fn set_hook_index(&mut self, val: usize) -> &mut Self
pub fn get_cleanups(&self) -> &Vec<Box<dyn FnOnce()>>
pub fn get_mut_cleanups(&mut self) -> &mut Vec<Box<dyn FnOnce()>>
pub fn set_cleanups(&mut self, val: Vec<Box<dyn FnOnce()>>) -> &mut Self
Trait Implementations§
Source§impl Debug for HookContextInner
impl Debug for HookContextInner
Source§impl Default for HookContextInner
Provides a default empty hook context inner.
impl Default for HookContextInner
Provides a default empty hook context inner.
Source§impl From<usize> for &'static HookContextInner
Implementation of From trait for converting usize address into &'static HookContextInner.
impl From<usize> for &'static HookContextInner
Implementation of From trait for converting usize address into &'static HookContextInner.
Source§fn from(address: usize) -> Self
fn from(address: usize) -> Self
Converts a memory address into a reference to HookContextInner.
§Arguments
usize- The memory address of theHookContextInnerinstance.
§Returns
&'static HookContextInner- A reference to theHookContextInnerat the given address.
§Safety
- The address is guaranteed to be a valid
HookContextInnerinstance that was previously converted from a reference and is managed by the runtime.
Source§impl From<usize> for &'static mut HookContextInner
Implementation of From trait for converting usize address into &'static mut HookContextInner.
impl From<usize> for &'static mut HookContextInner
Implementation of From trait for converting usize address into &'static mut HookContextInner.
Source§fn from(address: usize) -> Self
fn from(address: usize) -> Self
Converts a memory address into a mutable reference to HookContextInner.
§Arguments
usize- The memory address of theHookContextInnerinstance.
§Returns
&'static mut HookContextInner- A mutable reference to theHookContextInnerat the given address.
§Safety
- The address is guaranteed to be a valid
HookContextInnerinstance that was previously converted from a reference and is managed by the runtime.
Auto Trait Implementations§
impl Freeze for HookContextInner
impl !RefUnwindSafe for HookContextInner
impl !Send for HookContextInner
impl !Sync for HookContextInner
impl Unpin for HookContextInner
impl UnsafeUnpin for HookContextInner
impl !UnwindSafe for HookContextInner
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