pub struct SwitchSpec<'a> {
pub selector: &'a str,
pub cases: &'a [u64],
pub default_addr: u64,
pub dispatch: &'a str,
pub table_va: u64,
pub cmp_ip: u64,
}Expand description
Structured switch-dispatch spec, passed to
ArchCodec::encode_switch_dispatch. Holds everything the x86
MSVC encoder needs; arches that don’t model jump-table dispatch
return Unsupported.
Fields§
§selector: &'a strRegister name (e.g. "ecx") holding the case selector.
cases: &'a [u64]The case-target addresses, in case-index order.
default_addr: u64Target for out-of-range selectors.
dispatch: &'a strDispatch shape identifier — "msvc-jmp-table" today.
Implementations match on this and return Unsupported for
shapes they don’t recognise.
table_va: u64Absolute virtual address where the jump-table data lives.
cmp_ip: u64Absolute address of the dispatch’s first instruction.
Trait Implementations§
Source§impl<'a> Clone for SwitchSpec<'a>
impl<'a> Clone for SwitchSpec<'a>
Source§fn clone(&self) -> SwitchSpec<'a>
fn clone(&self) -> SwitchSpec<'a>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for SwitchSpec<'a>
impl<'a> Debug for SwitchSpec<'a>
impl<'a> Copy for SwitchSpec<'a>
Auto Trait Implementations§
impl<'a> Freeze for SwitchSpec<'a>
impl<'a> RefUnwindSafe for SwitchSpec<'a>
impl<'a> Send for SwitchSpec<'a>
impl<'a> Sync for SwitchSpec<'a>
impl<'a> Unpin for SwitchSpec<'a>
impl<'a> UnsafeUnpin for SwitchSpec<'a>
impl<'a> UnwindSafe for SwitchSpec<'a>
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