pub struct TriggerRule {
pub id: String,
pub name: String,
pub event_pattern: String,
pub condition: Option<Value>,
pub action_type: String,
pub action_config: Value,
pub enabled: bool,
pub priority: i32,
}Expand description
触发规则定义。
定义了一个事件模式到动作的映射规则。
Fields§
§id: String规则唯一 ID。
name: String规则名称(用于显示)。
event_pattern: String事件名称模式。
支持通配符:
user.created精确匹配user.*匹配单层通配user.**匹配多层通配
condition: Option<Value>条件过滤(JSON payload 字段匹配)。
例如: {"status": {"$eq": "published"}}
action_type: String动作类型(对应已注册的 action handler)。
action_config: Value动作配置(传递给 action handler 的参数)。
enabled: bool是否启用。
priority: i32优先级(数值越小越先执行)。
Trait Implementations§
Source§impl Clone for TriggerRule
impl Clone for TriggerRule
Source§fn clone(&self) -> TriggerRule
fn clone(&self) -> TriggerRule
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 TriggerRule
impl Debug for TriggerRule
Source§impl<'de> Deserialize<'de> for TriggerRule
impl<'de> Deserialize<'de> for TriggerRule
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 TriggerRule
impl RefUnwindSafe for TriggerRule
impl Send for TriggerRule
impl Sync for TriggerRule
impl Unpin for TriggerRule
impl UnsafeUnpin for TriggerRule
impl UnwindSafe for TriggerRule
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