pub struct ApproveAllHandler;Expand description
A SessionHandler that auto-approves all permissions and ignores all events.
Useful for CLI tools, scripts, and tests that don’t need interactive permission prompts or custom tool handling.
Trait Implementations§
Source§impl Clone for ApproveAllHandler
impl Clone for ApproveAllHandler
Source§fn clone(&self) -> ApproveAllHandler
fn clone(&self) -> ApproveAllHandler
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ApproveAllHandler
impl Debug for ApproveAllHandler
Source§impl SessionHandler for ApproveAllHandler
impl SessionHandler for ApproveAllHandler
Source§fn on_permission_request<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_request_id: RequestId,
_data: PermissionRequestData,
) -> Pin<Box<dyn Future<Output = PermissionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_permission_request<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_request_id: RequestId,
_data: PermissionRequestData,
) -> Pin<Box<dyn Future<Output = PermissionResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The CLI is asking whether the agent may perform a privileged action. Read more
Source§fn on_event<'life0, 'async_trait>(
&'life0 self,
event: HandlerEvent,
) -> Pin<Box<dyn Future<Output = HandlerResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_event<'life0, 'async_trait>(
&'life0 self,
event: HandlerEvent,
) -> Pin<Box<dyn Future<Output = HandlerResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Handle an event from the session. Read more
Source§fn on_session_event<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_event: SessionEvent,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_session_event<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_event: SessionEvent,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Informational timeline event (assistant messages, tool execution
markers, session idle, etc.). Fire-and-forget — the return value is
ignored. Read more
Source§fn on_user_input<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_question: String,
_choices: Option<Vec<String>>,
_allow_freeform: Option<bool>,
) -> Pin<Box<dyn Future<Output = Option<UserInputResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_user_input<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_question: String,
_choices: Option<Vec<String>>,
_allow_freeform: Option<bool>,
) -> Pin<Box<dyn Future<Output = Option<UserInputResponse>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The CLI is asking the user a question (optionally with a list of
choices). Read more
Source§fn on_external_tool<'life0, 'async_trait>(
&'life0 self,
invocation: ToolInvocation,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_external_tool<'life0, 'async_trait>(
&'life0 self,
invocation: ToolInvocation,
) -> Pin<Box<dyn Future<Output = ToolResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The CLI wants to invoke a client-defined (“external”) tool. Read more
Source§fn on_elicitation<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_request_id: RequestId,
_request: ElicitationRequest,
) -> Pin<Box<dyn Future<Output = ElicitationResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_elicitation<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_request_id: RequestId,
_request: ElicitationRequest,
) -> Pin<Box<dyn Future<Output = ElicitationResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The CLI is requesting an elicitation (structured form / URL prompt). Read more
Source§fn on_exit_plan_mode<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_data: ExitPlanModeData,
) -> Pin<Box<dyn Future<Output = ExitPlanModeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_exit_plan_mode<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_data: ExitPlanModeData,
) -> Pin<Box<dyn Future<Output = ExitPlanModeResult> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The CLI is asking the user whether to exit plan mode. Read more
Source§fn on_auto_mode_switch<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_error_code: Option<String>,
_retry_after_seconds: Option<u64>,
) -> Pin<Box<dyn Future<Output = AutoModeSwitchResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_auto_mode_switch<'life0, 'async_trait>(
&'life0 self,
_session_id: SessionId,
_error_code: Option<String>,
_retry_after_seconds: Option<u64>,
) -> Pin<Box<dyn Future<Output = AutoModeSwitchResponse> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
The CLI is asking whether to switch to auto model after an eligible
rate limit. Read more
Auto Trait Implementations§
impl Freeze for ApproveAllHandler
impl RefUnwindSafe for ApproveAllHandler
impl Send for ApproveAllHandler
impl Sync for ApproveAllHandler
impl Unpin for ApproveAllHandler
impl UnsafeUnpin for ApproveAllHandler
impl UnwindSafe for ApproveAllHandler
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