pub struct CommandTable {
pub base: usize,
pub stride: usize,
pub opcode_off: usize,
pub flags_off: usize,
pub handler_off: usize,
pub term_flag: u8,
pub max_records: usize,
}Expand description
Geometry of fixed-size opcode-dispatch records with big-endian pointers.
Fields§
§base: usizeFlat-image offset of the first record.
stride: usizeRecord size in bytes.
opcode_off: usizeOffset of the opcode byte inside each record.
flags_off: usizeOffset of the flags byte inside each record.
handler_off: usizeOffset of the four-byte big-endian handler inside each record.
term_flag: u8Flags byte marking the terminating record (not returned by the scan).
max_records: usizeMaximum number of records to inspect, including the terminator.
Implementations§
Source§impl CommandTable
impl CommandTable
Sourcepub fn walk(&self, image: &[u8]) -> Result<Vec<CommandRecord>, TableError>
pub fn walk(&self, image: &[u8]) -> Result<Vec<CommandRecord>, TableError>
Reads all records up to a required terminator. No partial result is returned.
Sourcepub fn find(
&self,
image: &[u8],
opcode: u8,
) -> Result<CommandRecord, TableError>
pub fn find( &self, image: &[u8], opcode: u8, ) -> Result<CommandRecord, TableError>
Finds the first matching opcode in a fully validated, terminated table.
Trait Implementations§
Source§impl Clone for CommandTable
impl Clone for CommandTable
impl Copy for CommandTable
Auto Trait Implementations§
impl Freeze for CommandTable
impl RefUnwindSafe for CommandTable
impl Send for CommandTable
impl Sync for CommandTable
impl Unpin for CommandTable
impl UnsafeUnpin for CommandTable
impl UnwindSafe for CommandTable
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