pub struct IntermediateObserver {
pub name: String,
pub entity: String,
pub event: String,
pub actions: Vec<IntermediateObserverAction>,
pub condition: Option<String>,
pub retry: IntermediateRetryConfig,
}Expand description
Observer definition in intermediate format.
Observers listen to database change events (INSERT/UPDATE/DELETE) and execute actions (webhooks, Slack, email) when conditions are met.
§Example JSON
{
"name": "onHighValueOrder",
"entity": "Order",
"event": "INSERT",
"condition": "total > 1000",
"actions": [
{
"type": "webhook",
"url": "https://api.example.com/orders",
"headers": {"Content-Type": "application/json"}
},
{
"type": "slack",
"channel": "#sales",
"message": "New order: {id}",
"webhook_url_env": "SLACK_WEBHOOK_URL"
}
],
"retry": {
"max_attempts": 3,
"backoff_strategy": "exponential",
"initial_delay_ms": 100,
"max_delay_ms": 60000
}
}Fields§
§name: StringObserver name (unique identifier)
entity: StringEntity type to observe (e.g., “Order”, “User”)
event: StringEvent type: INSERT, UPDATE, or DELETE
actions: Vec<IntermediateObserverAction>Actions to execute when observer triggers
condition: Option<String>Optional condition expression in FraiseQL DSL
retry: IntermediateRetryConfigRetry configuration for action execution
Trait Implementations§
Source§impl Clone for IntermediateObserver
impl Clone for IntermediateObserver
Source§fn clone(&self) -> IntermediateObserver
fn clone(&self) -> IntermediateObserver
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 IntermediateObserver
impl Debug for IntermediateObserver
Source§impl<'de> Deserialize<'de> for IntermediateObserver
impl<'de> Deserialize<'de> for IntermediateObserver
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
Source§impl PartialEq for IntermediateObserver
impl PartialEq for IntermediateObserver
Source§impl Serialize for IntermediateObserver
impl Serialize for IntermediateObserver
impl StructuralPartialEq for IntermediateObserver
Auto Trait Implementations§
impl Freeze for IntermediateObserver
impl RefUnwindSafe for IntermediateObserver
impl Send for IntermediateObserver
impl Sync for IntermediateObserver
impl Unpin for IntermediateObserver
impl UnwindSafe for IntermediateObserver
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