pub trait EventSink {
// Required method
fn emit_event(&mut self, event: &ProtocolEvent) -> Result<()>;
// Provided methods
fn reasoning_started(&mut self) -> Result<()> { ... }
fn reasoning_completed(&mut self) -> Result<()> { ... }
fn skill_instruction_attached(&mut self, _name: &str) -> Result<()> { ... }
fn context_usage(&mut self, _tokens: usize) -> Result<()> { ... }
fn compaction_started(&mut self) -> Result<()> { ... }
fn compaction_finished(
&mut self,
_tokens_before: usize,
_tokens_after: usize,
) -> Result<()> { ... }
}Expand description
The normalized event boundary shared by the machine protocol and the TUI.
Required Methods§
fn emit_event(&mut self, event: &ProtocolEvent) -> Result<()>
Provided Methods§
Sourcefn reasoning_started(&mut self) -> Result<()>
fn reasoning_started(&mut self) -> Result<()>
Notify interactive frontends that the provider sent genuine reasoning metadata. This is intentionally not part of the public protocol.
Sourcefn reasoning_completed(&mut self) -> Result<()>
fn reasoning_completed(&mut self) -> Result<()>
Notify interactive frontends after the provider’s reasoning metadata has ended. This is intentionally not part of the public protocol.
Sourcefn skill_instruction_attached(&mut self, _name: &str) -> Result<()>
fn skill_instruction_attached(&mut self, _name: &str) -> Result<()>
Notify interactive frontends after an explicit skill invocation was expanded from the immutable session snapshot. This is not a public JSONL protocol event.
Sourcefn context_usage(&mut self, _tokens: usize) -> Result<()>
fn context_usage(&mut self, _tokens: usize) -> Result<()>
Notify interactive frontends of the estimated prompt context size. This is intentionally not part of the public JSONL protocol.
Sourcefn compaction_started(&mut self) -> Result<()>
fn compaction_started(&mut self) -> Result<()>
Notify interactive frontends that an internal context compaction began. This is intentionally not part of the public JSONL protocol.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".