pub enum DecoratorStore {
Owned {
decorators: DecoratorList,
before_enter: Vec<DecoratorId>,
after_exit: Vec<DecoratorId>,
},
Linked {
id: MastNodeId,
},
}Expand description
A data structure for storing decorators for MAST nodes, including both operation-level decorators and node-level decorators (before_enter/after_exit).
Variants§
Owned
The decorators are owned by this node. This is the case for nodes which have not yet been inserted into a MAST forest.
Fields
decorators: DecoratorListOperation-level decorators indexed by operation position (Note: Only used by BasicBlockNode, other nodes will have empty decorators)
before_enter: Vec<DecoratorId>Node-level decorators executed before entering the node
after_exit: Vec<DecoratorId>Node-level decorators executed after exiting the node
Linked
The decorators are stored in a MAST forest and can be accessed via this node’s ID. All decorator reads borrow from the forest’s storage.
Fields
id: MastNodeIdImplementations§
Source§impl DecoratorStore
impl DecoratorStore
Sourcepub fn new_owned_with_decorators(
before_enter: Vec<DecoratorId>,
after_exit: Vec<DecoratorId>,
) -> Self
pub fn new_owned_with_decorators( before_enter: Vec<DecoratorId>, after_exit: Vec<DecoratorId>, ) -> Self
Create a new Owned decorator store with the specified before/after decorators
Sourcepub fn before_enter<'a>(&'a self, forest: &'a MastForest) -> &'a [DecoratorId]
pub fn before_enter<'a>(&'a self, forest: &'a MastForest) -> &'a [DecoratorId]
Get the before_enter decorators, borrowing from the forest if linked
Sourcepub fn after_exit<'a>(&'a self, forest: &'a MastForest) -> &'a [DecoratorId]
pub fn after_exit<'a>(&'a self, forest: &'a MastForest) -> &'a [DecoratorId]
Get the after_exit decorators, borrowing from the forest if linked
Sourcepub fn linked_id(&self) -> Option<MastNodeId>
pub fn linked_id(&self) -> Option<MastNodeId>
Get the node ID if this store is in the Linked state
Trait Implementations§
Source§impl Clone for DecoratorStore
impl Clone for DecoratorStore
Source§fn clone(&self) -> DecoratorStore
fn clone(&self) -> DecoratorStore
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more