pub trait MastNodeExt: Send + Sync {
// Required method
fn decorators(&self) -> impl Iterator<Item = (usize, DecoratorId)>;
// Provided method
fn get_assembly_op<'m>(
&self,
mast_forest: &'m MastForest,
target_op_idx: Option<usize>,
) -> Option<&'m AssemblyOp> { ... }
}
Expand description
A trait for extending the functionality of all MastNode
s.
Required Methods§
Sourcefn decorators(&self) -> impl Iterator<Item = (usize, DecoratorId)>
fn decorators(&self) -> impl Iterator<Item = (usize, DecoratorId)>
The list of decorators tied to this node, along with their associated index.
The index is only meaningful for BasicBlockNode
s, where it corresponds to the index of
the operation in the basic block to which the decorator is attached.
Provided Methods§
Sourcefn get_assembly_op<'m>(
&self,
mast_forest: &'m MastForest,
target_op_idx: Option<usize>,
) -> Option<&'m AssemblyOp>
fn get_assembly_op<'m>( &self, mast_forest: &'m MastForest, target_op_idx: Option<usize>, ) -> Option<&'m AssemblyOp>
Returns the AssemblyOp
associated with this node and operation (if provided), if any.
If the target_op_idx
is provided, the method treats the wrapped node as a basic block will
return the assembly op associated with the operation at the corresponding index in the basic
block. If no target_op_idx
is provided, the method will return the first assembly op found
(effectively assuming that the node has at most one associated AssemblyOp
).
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.