pub enum Element {
Microcode(Microcode),
Block(Block),
Branch(Branch),
}Expand description
Defines elements that make up the code flow of an instruction.
Variants§
Microcode(Microcode)
Execute this single microcode instruction. The instruction must not be Skip or
SkipIf.
Block(Block)
Execute a sequence of elements in order.
Branch(Branch)
Branch and execute one of two sequences of elements.
Implementations§
Source§impl Element
impl Element
Sourcepub fn flatten(&self) -> Vec<Microcode>
pub fn flatten(&self) -> Vec<Microcode>
Convert this Element to a flat list of microcode instructions.
Sourcepub fn extend_block(&mut self, other: Element)
pub fn extend_block(&mut self, other: Element)
Run other after self. Transforms self into a Block if necessary to append
other and adds its elements after the current value.
Sourcepub fn ends_with_terminal(&self) -> bool
pub fn ends_with_terminal(&self) -> bool
Return true if the given element ends with FetchNextInstruction, ParseOpcode, or ParseCBOpcode. For Branches, only returns true if all branches end with one of those opcodes.
Sourcepub fn get<I>(&self, index: I) -> Option<&Element>where
I: ElementIndex,
pub fn get<I>(&self, index: I) -> Option<&Element>where
I: ElementIndex,
Get an element by index relative to self.
Sourcepub fn get_mut<I>(&mut self, index: I) -> Option<&mut Element>where
I: ElementIndex,
pub fn get_mut<I>(&mut self, index: I) -> Option<&mut Element>where
I: ElementIndex,
Get an element by index relative to self.
Trait Implementations§
Source§impl<I: ElementIndex> Index<I> for Element
impl<I: ElementIndex> Index<I> for Element
Auto Trait Implementations§
impl Freeze for Element
impl RefUnwindSafe for Element
impl Send for Element
impl Sync for Element
impl Unpin for Element
impl UnwindSafe for Element
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