pub struct Rule {
pub id: String,
pub priority: i32,
pub predicate: Predicate,
pub action: String,
}Expand description
An individual rule with conditions and action.
§Fields
id: Unique identifier for the rulepriority: Execution priority (lower = higher precedence, default: 0)predicate: Condition tree (deserialized fromconditionsfield)action: Action identifier (informational, not executed by engine)
§JSON Format
{
"id": "Premium_User",
"priority": 1,
"conditions": {"user.tier": {"$eq": "Gold"}},
"action": "apply_discount"
}Fields§
§id: String§priority: i32§predicate: Predicate§action: StringTrait 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