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
)