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§impl Debug for JumpTableData
impl Debug for JumpTableData
§impl<'de> Deserialize<'de> for JumpTableData
impl<'de> Deserialize<'de> for JumpTableData
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<JumpTableData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<JumpTableData, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
§impl Hash for JumpTableData
impl Hash for JumpTableData
§impl PartialEq for JumpTableData
impl PartialEq for JumpTableData
§impl Serialize for JumpTableData
impl Serialize for JumpTableData
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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
)