pub struct DenyAllHandler;Expand description
A SessionHandler that denies all permission requests and otherwise
relies on the trait’s default fallback responses for every other event
(e.g. tool invocations return “unhandled”, elicitations cancel, plan-mode
prompts decline). This is the safe default used when no handler is set on
SessionConfig::handler — sessions
will not stall on permission prompts (they’re denied immediately) but no
privileged actions will be taken without an explicit opt-in.
Trait Implementations§
Source§impl Clone for DenyAllHandler
impl Clone for DenyAllHandler
Source§fn clone(&self) -> DenyAllHandler
fn clone(&self) -> DenyAllHandler
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 DenyAllHandler
impl Debug for DenyAllHandler
Source§impl SessionHandler for DenyAllHandler
impl SessionHandler for DenyAllHandler
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_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_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<f64>,
) -> 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<f64>,
) -> 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 DenyAllHandler
impl RefUnwindSafe for DenyAllHandler
impl Send for DenyAllHandler
impl Sync for DenyAllHandler
impl Unpin for DenyAllHandler
impl UnsafeUnpin for DenyAllHandler
impl UnwindSafe for DenyAllHandler
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