pub struct VisibleMessageStream { /* private fields */ }Expand description
Per-run message-only replay and broadcast state.
The replay is intentionally not byte-capped: it contains only visible text generated by the current run and remains authoritative until durable history is acknowledged. Silently evicting it would make late subscribers lose text.
Implementations§
Source§impl VisibleMessageStream
impl VisibleMessageStream
pub fn new() -> Self
Sourcepub fn subscribe_with_snapshot(
&self,
) -> (Receiver<VisibleMessageEvent>, VisibleMessageSnapshot)
pub fn subscribe_with_snapshot( &self, ) -> (Receiver<VisibleMessageEvent>, VisibleMessageSnapshot)
Subscribe before taking the snapshot. Concurrent events are either in the snapshot or queued with a greater version, never neither.
pub fn begin_round(&self, round_count: u32)
Sourcepub fn start(&self, message_id: String, created_at: DateTime<Utc>)
pub fn start(&self, message_id: String, created_at: DateTime<Utc>)
Start one provider response. Previous segments remain replayable until an explicit discard or the durable-history barrier; a later attempt in the same round does not prove the earlier segment was rolled back.
Sourcepub fn append(&self, content: String)
pub fn append(&self, content: String)
Append visible assistant text. Legacy producers without an explicit start receive a host-minted temporary identity and reconcile on history commit.
pub fn discard(&self, message_id: &str)
pub fn mark_terminal(&self, reason: impl Into<String>)
Sourcepub fn history_committed(&self)
pub fn history_committed(&self)
Clear replay only after durable history has actually been published.