pub trait RunSubscriptionSource: Send + Sync {
// Required methods
fn subscribe_all(
&self,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>;
fn subscribe_run(
&self,
run_id: RunId,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>;
fn subscribe_agent(
&self,
agent_id: AgentId,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>;
fn subscribe_events(
&self,
filter: CompiledEventFilter,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>;
fn replay_run_from_cursor(
&self,
run_id: RunId,
cursor: JournalCursor,
) -> Result<AgentEventStream, AgentError>;
fn latest_terminal_event(
&self,
run_id: &RunId,
) -> Result<Option<EventFrame>, AgentError>;
}Expand description
Port or behavior contract for run subscription source. Implementors should preserve policy, redaction, idempotency, and replay expectations from the surrounding module. Implementations may perform side effects only as described by the trait methods.
Required Methods§
Sourcefn subscribe_all(
&self,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>
fn subscribe_all( &self, cursor: Option<EventCursor>, ) -> Result<AgentEventStream, AgentError>
Creates a read-only event stream for all visible events. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Sourcefn subscribe_run(
&self,
run_id: RunId,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>
fn subscribe_run( &self, run_id: RunId, cursor: Option<EventCursor>, ) -> Result<AgentEventStream, AgentError>
Creates a read-only event stream scoped to one run. This is data-only and does not perform I/O, call host ports, append journals, publish events, or start processes.
Sourcefn subscribe_agent(
&self,
agent_id: AgentId,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>
fn subscribe_agent( &self, agent_id: AgentId, cursor: Option<EventCursor>, ) -> Result<AgentEventStream, AgentError>
Creates a read-only event stream scoped to one agent. Implementations create a read-only subscription or replay stream; the call must not start runs, publish events, or append journal records.
Sourcefn subscribe_events(
&self,
filter: CompiledEventFilter,
cursor: Option<EventCursor>,
) -> Result<AgentEventStream, AgentError>
fn subscribe_events( &self, filter: CompiledEventFilter, cursor: Option<EventCursor>, ) -> Result<AgentEventStream, AgentError>
Creates a read-only event stream matching a compiled filter. Implementations create a read-only subscription or replay stream; the call must not start runs, publish events, or append journal records.
Sourcefn replay_run_from_cursor(
&self,
run_id: RunId,
cursor: JournalCursor,
) -> Result<AgentEventStream, AgentError>
fn replay_run_from_cursor( &self, run_id: RunId, cursor: JournalCursor, ) -> Result<AgentEventStream, AgentError>
Replays one run from durable cursor state. Implementations create a read-only subscription or replay stream; the call must not start runs, publish events, or append journal records.
Sourcefn latest_terminal_event(
&self,
run_id: &RunId,
) -> Result<Option<EventFrame>, AgentError>
fn latest_terminal_event( &self, run_id: &RunId, ) -> Result<Option<EventFrame>, AgentError>
Reads the latest terminal event for one run, when available. Implementations read subscription state for the latest terminal frame; the lookup must not publish events or alter run state.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".