pub struct InstructionTree<T>{ /* private fields */ }Expand description
A generic tree structure for instructions with child instructions.
Implementations§
Source§impl InstructionTree<InstructionWithSpan>
impl InstructionTree<InstructionWithSpan>
Sourcepub fn flatten_instructions(self) -> Vec<InstructionWithSpan>
pub fn flatten_instructions(self) -> Vec<InstructionWithSpan>
Flattens the tree into a list of instructions, also recursively flattens instructions like RegularInstruction::_RemoteExecutionDebugTree into RegularInstruction::_RemoteExecutionDebugFlat
Source§impl InstructionTree<Instruction>
impl InstructionTree<Instruction>
Sourcepub fn flatten_instructions(self) -> Vec<Instruction>
pub fn flatten_instructions(self) -> Vec<Instruction>
Flattens the tree into a list of instructions,
Source§impl<T> InstructionTree<T>
impl<T> InstructionTree<T>
Sourcepub fn new_with_children(
instruction: T,
children: Vec<InstructionTree<T>>,
) -> Self
pub fn new_with_children( instruction: T, children: Vec<InstructionTree<T>>, ) -> Self
Create a new tree with a root instruction and children
Sourcepub fn map<N: Debug + Clone>(
self,
f: impl Fn(T) -> N + Clone,
) -> InstructionTree<N>
pub fn map<N: Debug + Clone>( self, f: impl Fn(T) -> N + Clone, ) -> InstructionTree<N>
Maps a tree to an instruction tree with a different generic type with a mapping function, preserving the structure
pub fn children(&self) -> &Vec<InstructionTree<T>>
pub fn instruction(&self) -> &T
Trait Implementations§
Source§impl<T> Clone for InstructionTree<T>
impl<T> Clone for InstructionTree<T>
Source§impl<T> Debug for InstructionTree<T>
impl<T> Debug for InstructionTree<T>
Source§impl Default for InstructionTree<Instruction>
impl Default for InstructionTree<Instruction>
Source§impl From<Instruction> for InstructionTree<InstructionWithSpan>
impl From<Instruction> for InstructionTree<InstructionWithSpan>
Source§fn from(instruction: Instruction) -> Self
fn from(instruction: Instruction) -> Self
Converts to this type from the input type.
Source§impl From<InstructionTree<Instruction>> for InstructionTree<InstructionWithSpan>
impl From<InstructionTree<Instruction>> for InstructionTree<InstructionWithSpan>
Source§fn from(value: InstructionTree<Instruction>) -> Self
fn from(value: InstructionTree<Instruction>) -> Self
Converts to this type from the input type.
Source§impl From<InstructionTree<InstructionWithSpan>> for InstructionTree<Instruction>
impl From<InstructionTree<InstructionWithSpan>> for InstructionTree<Instruction>
Source§fn from(value: InstructionTree<InstructionWithSpan>) -> Self
fn from(value: InstructionTree<InstructionWithSpan>) -> Self
Converts to this type from the input type.
Source§impl From<RegularInstruction> for InstructionTree<Instruction>
impl From<RegularInstruction> for InstructionTree<Instruction>
Source§fn from(instruction: RegularInstruction) -> Self
fn from(instruction: RegularInstruction) -> Self
Converts to this type from the input type.
Source§impl From<RegularInstruction> for InstructionTree<InstructionWithSpan>
impl From<RegularInstruction> for InstructionTree<InstructionWithSpan>
Source§fn from(instruction: RegularInstruction) -> Self
fn from(instruction: RegularInstruction) -> Self
Converts to this type from the input type.
Source§impl<T> From<T> for InstructionTree<T>
impl<T> From<T> for InstructionTree<T>
Source§impl From<TypeInstruction> for InstructionTree<Instruction>
impl From<TypeInstruction> for InstructionTree<Instruction>
Source§fn from(instruction: TypeInstruction) -> Self
fn from(instruction: TypeInstruction) -> Self
Converts to this type from the input type.
Source§impl From<TypeInstruction> for InstructionTree<InstructionWithSpan>
impl From<TypeInstruction> for InstructionTree<InstructionWithSpan>
Source§fn from(instruction: TypeInstruction) -> Self
fn from(instruction: TypeInstruction) -> Self
Converts to this type from the input type.
Source§impl From<Vec<InstructionTree<Instruction>>> for InstructionTree<Instruction>
impl From<Vec<InstructionTree<Instruction>>> for InstructionTree<Instruction>
Source§fn from(instruction_trees: Vec<InstructionTree<Instruction>>) -> Self
fn from(instruction_trees: Vec<InstructionTree<Instruction>>) -> Self
Converts to this type from the input type.
Source§impl<T> PartialEq for InstructionTree<T>
impl<T> PartialEq for InstructionTree<T>
Source§impl<T> Serialize for InstructionTree<T>
impl<T> Serialize for InstructionTree<T>
impl<T> StructuralPartialEq for InstructionTree<T>
Auto Trait Implementations§
impl<T> Forget for InstructionTree<T>
impl<T> Freeze for InstructionTree<T>
impl<T> Move for InstructionTree<T>
impl<T> RefUnwindSafe for InstructionTree<T>
impl<T> Send for InstructionTree<T>
impl<T> Sync for InstructionTree<T>
impl<T> Unpin for InstructionTree<T>
impl<T> UnsafeUnpin for InstructionTree<T>
impl<T> UnwindSafe for InstructionTree<T>
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Serialize for T
impl<T> Serialize for T
fn erased_serialize(&self, serializer: &mut dyn Serializer) -> Result<(), Error>
fn do_erased_serialize( &self, serializer: &mut dyn Serializer, ) -> Result<(), ErrorImpl>
Source§impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
impl<T, U> TypeSubset<U> for Twhere
U: TypeSuperset<T>,
Source§fn is_subset_of(&self, other: &U) -> bool
fn is_subset_of(&self, other: &U) -> bool
Returns whether self is a subset of type