pub struct JumpTableData { /* private fields */ }
Expand description
Contents of a jump table.
All jump tables use 0-based indexing and are densely populated.
The default block for the jump table is stored as the first element of the underlying vector.
It can be accessed through the default_block
and default_block_mut
functions. All blocks
may be iterated using the all_branches
and all_branches_mut
functions, which will both
iterate over the default block first.
Implementations§
source§impl JumpTableData
impl JumpTableData
sourcepub fn new(def: BlockCall, table: &[BlockCall]) -> Self
pub fn new(def: BlockCall, table: &[BlockCall]) -> Self
Create a new jump table with the provided blocks.
sourcepub fn default_block(&self) -> BlockCall
pub fn default_block(&self) -> BlockCall
Fetch the default block for this jump table.
sourcepub fn default_block_mut(&mut self) -> &mut BlockCall
pub fn default_block_mut(&mut self) -> &mut BlockCall
Mutable access to the default block of this jump table.
sourcepub fn all_branches(&self) -> &[BlockCall]
pub fn all_branches(&self) -> &[BlockCall]
The jump table and default block as a single slice. The default block will always be first.
sourcepub fn all_branches_mut(&mut self) -> &mut [BlockCall]
pub fn all_branches_mut(&mut self) -> &mut [BlockCall]
The jump table and default block as a single mutable slice. The default block will always be first.
sourcepub fn as_slice(&self) -> &[BlockCall]
pub fn as_slice(&self) -> &[BlockCall]
Access the jump table as a slice. This excludes the default block.
sourcepub fn as_mut_slice(&mut self) -> &mut [BlockCall]
pub fn as_mut_slice(&mut self) -> &mut [BlockCall]
Access the jump table as a mutable slice. This excludes the default block.
sourcepub fn iter(&self) -> Iter<'_, BlockCall>
👎Deprecated since 7.0.0: please use .as_slice()
instead
pub fn iter(&self) -> Iter<'_, BlockCall>
.as_slice()
insteadReturns an iterator to the jump table, excluding the default block.
sourcepub fn iter_mut(&mut self) -> IterMut<'_, BlockCall>
👎Deprecated since 7.0.0: please use .as_mut_slice()
instead
pub fn iter_mut(&mut self) -> IterMut<'_, BlockCall>
.as_mut_slice()
insteadReturns an iterator that allows modifying each value, excluding the default block.
sourcepub fn display<'a>(&'a self, pool: &'a ValueListPool) -> DisplayJumpTable<'a>
pub fn display<'a>(&'a self, pool: &'a ValueListPool) -> DisplayJumpTable<'a>
Return a value that can display the contents of this jump table.
Trait Implementations§
source§impl Clone for JumpTableData
impl Clone for JumpTableData
source§fn clone(&self) -> JumpTableData
fn clone(&self) -> JumpTableData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for JumpTableData
impl Debug for JumpTableData
source§impl Hash for JumpTableData
impl Hash for JumpTableData
source§impl PartialEq for JumpTableData
impl PartialEq for JumpTableData
impl StructuralPartialEq for JumpTableData
Auto Trait Implementations§
impl Freeze for JumpTableData
impl RefUnwindSafe for JumpTableData
impl Send for JumpTableData
impl Sync for JumpTableData
impl Unpin for JumpTableData
impl UnwindSafe for JumpTableData
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)