pub enum InstructionModifier {
StateAppend(Vec<String>),
CustomAppend(Arc<dyn Fn(&State) -> String + Send + Sync>),
Conditional {
predicate: Arc<dyn Fn(&State) -> bool + Send + Sync>,
text: String,
},
}Expand description
A modifier that transforms a phase instruction based on runtime state.
Modifiers are evaluated in order during instruction composition. They compose additively — each appends to the instruction built so far.
Variants§
StateAppend(Vec<String>)
Append formatted state values: [Context: key1=val1, key2=val2, ...]
CustomAppend(Arc<dyn Fn(&State) -> String + Send + Sync>)
Append the result of a custom formatter function.
Conditional
Conditionally append text when a predicate is true.
Implementations§
Trait Implementations§
Source§impl Clone for InstructionModifier
impl Clone for InstructionModifier
Source§fn clone(&self) -> InstructionModifier
fn clone(&self) -> InstructionModifier
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for InstructionModifier
impl !RefUnwindSafe for InstructionModifier
impl Send for InstructionModifier
impl Sync for InstructionModifier
impl Unpin for InstructionModifier
impl !UnwindSafe for InstructionModifier
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