rightkit_agent_engine_protocol/event/
durability.rs1use super::ProtocolEvent;
2
3#[derive(Debug, Clone, Copy, PartialEq, Eq)]
7pub enum EventDurability {
8 DurableFact,
9 LiveProjection,
10}
11
12impl ProtocolEvent {
13 pub fn durability(&self) -> EventDurability {
17 match self {
18 Self::AssistantDelta { .. }
19 | Self::ToolOutputDelta { .. }
20 | Self::StreamResyncRequired { .. }
21 | Self::PersistenceFailed { .. } => EventDurability::LiveProjection,
22 _ => EventDurability::DurableFact,
23 }
24 }
25
26 pub fn is_durable_fact(&self) -> bool {
27 self.durability() == EventDurability::DurableFact
28 }
29}