pub struct OperationTable { /* private fields */ }Expand description
256-entry selector dispatch table.
Implementations§
Source§impl OperationTable
impl OperationTable
Sourcepub fn register(
&mut self,
selector: u8,
name: impl Into<String>,
func: OpFn,
arg: OpArg,
)
pub fn register( &mut self, selector: u8, name: impl Into<String>, func: OpFn, arg: OpArg, )
Register an operation at a raw byte selector.
Sourcepub fn register_word(
&mut self,
selector: SelectorWord,
name: impl Into<String>,
func: OpFn,
arg: OpArg,
)
pub fn register_word( &mut self, selector: SelectorWord, name: impl Into<String>, func: OpFn, arg: OpArg, )
Register using a 4/4/8 selector word.
Sourcepub fn execute(&self, selector: u8, frame: OpFrame) -> DispatchResult<OpFrame>
pub fn execute(&self, selector: u8, frame: OpFrame) -> DispatchResult<OpFrame>
Execute by raw selector.
Sourcepub fn execute_word(
&self,
selector: SelectorWord,
frame: OpFrame,
) -> DispatchResult<OpFrame>
pub fn execute_word( &self, selector: SelectorWord, frame: OpFrame, ) -> DispatchResult<OpFrame>
Execute by selector word. Runtime uses the low 8 function bits as the table index.
Sourcepub fn execute_or_nop(&self, selector: u8, frame: OpFrame) -> OpFrame
pub fn execute_or_nop(&self, selector: u8, frame: OpFrame) -> OpFrame
Execute a selector without a branch in user code by falling back to NOP for missing entries.
This still uses an internal Option branch; use it as an ergonomic hot-loop shape, not a hard side-channel guarantee.
Trait Implementations§
Source§impl Clone for OperationTable
impl Clone for OperationTable
Source§impl Debug for OperationTable
impl Debug for OperationTable
Auto Trait Implementations§
impl Freeze for OperationTable
impl RefUnwindSafe for OperationTable
impl Send for OperationTable
impl Sync for OperationTable
impl Unpin for OperationTable
impl UnsafeUnpin for OperationTable
impl UnwindSafe for OperationTable
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