Struct JumpTableData
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§
§impl JumpTableData
impl JumpTableData
pub fn new(def: BlockCall, table: &[BlockCall]) -> JumpTableData
pub fn new(def: BlockCall, table: &[BlockCall]) -> JumpTableData
Create a new jump table with the provided blocks.
pub fn default_block(&self) -> BlockCall
pub fn default_block(&self) -> BlockCall
Fetch the default block for this jump table.
pub 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.
pub 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.
pub 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.
pub fn as_slice(&self) -> &[BlockCall]
pub fn as_slice(&self) -> &[BlockCall]
Access the jump table as a slice. This excludes the default block.
pub 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.
pub 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.
pub 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.
pub fn clear(&mut self)
pub fn clear(&mut self)
Clears all entries in this jump table, except for the default block.
Trait Implementations§
§impl Clone for JumpTableData
impl Clone for JumpTableData
§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 more