pub struct RuleCondition {
pub action_type: Option<String>,
pub command_pattern: Option<String>,
pub description_pattern: Option<String>,
pub workflow_id: Option<String>,
pub time_range: Option<String>,
pub cost_above: Option<f64>,
}Expand description
Conditions under which a rule applies.
Fields§
§action_type: Option<String>Match against action type (e.g., “execute”, “api_call”, “write”).
command_pattern: Option<String>Glob pattern to match against action command.
description_pattern: Option<String>Glob pattern to match against action description.
workflow_id: Option<String>Match against workflow ID.
time_range: Option<String>Match against time-of-day range (e.g., “09:00-17:00”).
cost_above: Option<f64>Match against cost threshold (action cost must exceed this).
Implementations§
Source§impl RuleCondition
impl RuleCondition
Sourcepub fn matches(&self, ctx: &RuleContext) -> bool
pub fn matches(&self, ctx: &RuleContext) -> bool
Check if this condition matches a given context.
Trait Implementations§
Source§impl Clone for RuleCondition
impl Clone for RuleCondition
Source§fn clone(&self) -> RuleCondition
fn clone(&self) -> RuleCondition
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 moreSource§impl Debug for RuleCondition
impl Debug for RuleCondition
Source§impl<'de> Deserialize<'de> for RuleCondition
impl<'de> Deserialize<'de> for RuleCondition
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for RuleCondition
impl RefUnwindSafe for RuleCondition
impl Send for RuleCondition
impl Sync for RuleCondition
impl Unpin for RuleCondition
impl UnsafeUnpin for RuleCondition
impl UnwindSafe for RuleCondition
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