pub enum PermissionMode {
Default,
AcceptEdits,
Plan,
DontAsk,
BypassPermissions,
}Expand description
Permission modes — same set as the Claude Agent SDK doc.
Variants§
Default
Calls the hook; deny if no hook is set.
AcceptEdits
Auto-approves Read/Write/Edit/Glob/Grep and falls back to the hook for everything else.
Plan
Read-only — denies any tool whose read_only_hint() is false.
DontAsk
Never asks; everything not pre-allowed is denied.
BypassPermissions
Allow everything. Use only in sandboxes.
Implementations§
Source§impl PermissionMode
impl PermissionMode
Sourcepub fn evaluate(
self,
tool_name: &str,
read_only_hint: bool,
) -> PermissionDecision
pub fn evaluate( self, tool_name: &str, read_only_hint: bool, ) -> PermissionDecision
Apply the mode to a single tool call. read_only_hint reflects the
tool’s annotation. Returns Allow, Deny(reason), or Ask (only the
Default mode and AcceptEdits fallback ever return Ask).
Trait Implementations§
Source§impl Clone for PermissionMode
impl Clone for PermissionMode
Source§fn clone(&self) -> PermissionMode
fn clone(&self) -> PermissionMode
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 PermissionMode
impl Debug for PermissionMode
Source§impl Default for PermissionMode
impl Default for PermissionMode
Source§fn default() -> PermissionMode
fn default() -> PermissionMode
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for PermissionMode
impl<'de> Deserialize<'de> for PermissionMode
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for PermissionMode
impl PartialEq for PermissionMode
Source§fn eq(&self, other: &PermissionMode) -> bool
fn eq(&self, other: &PermissionMode) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for PermissionMode
impl Serialize for PermissionMode
impl Copy for PermissionMode
impl Eq for PermissionMode
impl StructuralPartialEq for PermissionMode
Auto Trait Implementations§
impl Freeze for PermissionMode
impl RefUnwindSafe for PermissionMode
impl Send for PermissionMode
impl Sync for PermissionMode
impl Unpin for PermissionMode
impl UnsafeUnpin for PermissionMode
impl UnwindSafe for PermissionMode
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