pub enum ControllerEvent {
StreamStart {
session_id: i64,
message_id: String,
model: String,
turn_id: Option<TurnId>,
},
TextChunk {
session_id: i64,
text: String,
turn_id: Option<TurnId>,
},
ToolUseStart {
session_id: i64,
tool_id: String,
tool_name: String,
turn_id: Option<TurnId>,
},
ToolUse {
session_id: i64,
tool: ToolUseInfo,
display_name: Option<String>,
display_title: Option<String>,
turn_id: Option<TurnId>,
},
Complete {
session_id: i64,
stop_reason: Option<String>,
turn_id: Option<TurnId>,
},
Error {
session_id: i64,
error: String,
turn_id: Option<TurnId>,
},
TokenUpdate {
session_id: i64,
input_tokens: i64,
output_tokens: i64,
context_limit: i32,
},
ToolResult {
session_id: i64,
tool_use_id: String,
tool_name: String,
display_name: Option<String>,
status: ToolResultStatus,
content: String,
error: Option<String>,
turn_id: Option<TurnId>,
},
CommandComplete {
session_id: i64,
command: ControlCmd,
success: bool,
message: Option<String>,
},
UserInteractionRequired {
session_id: i64,
tool_use_id: String,
request: AskUserQuestionsRequest,
turn_id: Option<TurnId>,
},
PermissionRequired {
session_id: i64,
tool_use_id: String,
request: PermissionRequest,
turn_id: Option<TurnId>,
},
BatchPermissionRequired {
session_id: i64,
batch: BatchPermissionRequest,
turn_id: Option<TurnId>,
},
}Expand description
Event emitted by the controller
Variants§
StreamStart
Streaming has started
TextChunk
Text chunk from LLM response
ToolUseStart
Tool use block has started (streaming)
ToolUse
Tool use requested by LLM (complete)
Fields
§
tool: ToolUseInfoComplete
Response complete
Error
Error occurred
TokenUpdate
Token usage update
ToolResult
Individual tool execution result (for UI feedback during batch execution)
Fields
§
status: ToolResultStatusCommandComplete
Control command completed
UserInteractionRequired
Tool is blocked waiting for user interaction (questions)
PermissionRequired
Tool is blocked waiting for permission from user
BatchPermissionRequired
Multiple tools are blocked waiting for batch permission from user. This is used when parallel tools need permissions - presenting all requests together avoids deadlocks and allows the user to make informed decisions.
Trait Implementations§
Source§impl Clone for ControllerEvent
impl Clone for ControllerEvent
Source§fn clone(&self) -> ControllerEvent
fn clone(&self) -> ControllerEvent
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ControllerEvent
impl RefUnwindSafe for ControllerEvent
impl Send for ControllerEvent
impl Sync for ControllerEvent
impl Unpin for ControllerEvent
impl UnwindSafe for ControllerEvent
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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