pub struct Rule {
pub id: String,
pub name: String,
pub description: String,
pub conditions: Vec<RuleCondition>,
pub actions: Vec<RuleAction>,
pub priority: u32,
pub enabled: bool,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub metadata: HashMap<String, String>,
}Expand description
Rule definition
Fields§
§id: StringUnique rule identifier
name: StringHuman-readable rule name
description: StringRule description
conditions: Vec<RuleCondition>Rule conditions that must be met
actions: Vec<RuleAction>Actions to execute when conditions are met
priority: u32Rule priority (higher number = higher priority)
enabled: boolWhether the rule is enabled
created_at: DateTime<Utc>Rule creation timestamp
updated_at: DateTime<Utc>Rule last modified timestamp
metadata: HashMap<String, String>Rule metadata
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn new(
id: String,
name: String,
conditions: Vec<RuleCondition>,
actions: Vec<RuleAction>,
) -> Self
pub fn new( id: String, name: String, conditions: Vec<RuleCondition>, actions: Vec<RuleAction>, ) -> Self
Create a new rule
Sourcepub fn new_with_generated_id(
name: String,
conditions: Vec<RuleCondition>,
actions: Vec<RuleAction>,
) -> Self
pub fn new_with_generated_id( name: String, conditions: Vec<RuleCondition>, actions: Vec<RuleAction>, ) -> Self
Create a new rule with generated ID
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
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 Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnwindSafe for Rule
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