pub struct FrontendAttachment {
pub descriptor: FrontendRuntimeDescriptor,
pub history: Vec<ChatMessage>,
pub history_cursor: u64,
/* private fields */
}Expand description
Atomic history/replay/live attachment to one runtime.
Fields§
§descriptor: FrontendRuntimeDescriptorRuntime description captured at attachment time.
history: Vec<ChatMessage>Bounded canonical history through history_cursor.
history_cursor: u64Highest event sequence already represented by history.
Implementations§
Source§impl FrontendAttachment
impl FrontendAttachment
Sourcepub fn from_snapshot(
snapshot: FrontendAttachSnapshot,
live: Receiver<FrontendEvent>,
) -> Self
pub fn from_snapshot( snapshot: FrontendAttachSnapshot, live: Receiver<FrontendEvent>, ) -> Self
Build an in-process attachment from a serialized snapshot and a live SDK event receiver. Runtime adapters use this constructor in tests and protocol bridges without acquiring transport ownership.
Sourcepub fn from_snapshot_after(
snapshot: FrontendAttachSnapshot,
live: Receiver<FrontendEvent>,
acknowledged_sequence: u64,
) -> Self
pub fn from_snapshot_after( snapshot: FrontendAttachSnapshot, live: Receiver<FrontendEvent>, acknowledged_sequence: u64, ) -> Self
Build an attachment that resumes after a sequence acknowledged by a prior transport connection. Snapshot replay and any overlapping live events at or below the cursor are skipped without changing canonical history or event payloads.
Sourcepub async fn next_event(
&mut self,
) -> Result<FrontendEvent, FrontendRuntimeError>
pub async fn next_event( &mut self, ) -> Result<FrontendEvent, FrontendRuntimeError>
Receive the next event not already represented by the history or a prior replay item. Duplicate events queued during attachment are skipped by sequence.
Sourcepub fn next_replay_event(&mut self) -> Option<FrontendEvent>
pub fn next_replay_event(&mut self) -> Option<FrontendEvent>
Drain one event from the finite attachment replay without waiting for live input. Interactive frontends use this to project the complete atomic snapshot before accepting keystrokes, so a historical resolved request never appears transiently actionable.