pub enum Event {
SessionStart,
Heartbeat,
Stop,
PromptSubmit,
SessionEnd,
Status,
Call,
Watch,
}Expand description
Lifecycle events this helper knows. Anything else is a caller mistake worth naming rather than a silent success.
Variants§
SessionStart
A conversation started: publish presence and return the context the host injects into the model.
Heartbeat
Keep the window’s presence alive mid-conversation.
Stop
The turn ended; the window is still open. Reports the model idle.
PromptSubmit
The user submitted a prompt: a turn is starting. Reports the model attending.
SessionEnd
The window is closing.
Status
What this binding is, for troubleshooting. Never prints a secret.
Call
One MCP tool call as the bound window (--tool, --args), printing
the tool’s structured content. Silent, like the presence events,
when the binding is missing or carries no credential. Only the tools
in HOOK_CALL_TOOLS are served: a hook must not be able to issue,
rotate or revoke a credential, nor act on the bus beyond what its
scripts need.
Watch
Watch the bus for this window while it sits idle, and return (exit 2)
only when something new is addressed to it: a host that runs this as
a background, rewaking hook (Claude Code’s asyncRewake) then wakes
the idle session with the returned text. Silent and exit 0 when the
deadline passes, the binding closes, or a newer watcher of the same
window replaces this one.
Trait Implementations§
impl Copy for Event
impl Eq for Event
impl StructuralPartialEq for Event
Auto Trait Implementations§
impl Freeze for Event
impl RefUnwindSafe for Event
impl Send for Event
impl Sync for Event
impl Unpin for Event
impl UnsafeUnpin for Event
impl UnwindSafe for Event
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more