pub struct PermissionSuggestion {
pub suggestion_type: PermissionType,
pub destination: PermissionDestination,
pub mode: Option<PermissionModeName>,
pub behavior: Option<PermissionBehavior>,
pub rules: Option<Vec<Value>>,
}Expand description
A suggested permission for tool approval.
When Claude requests tool permission, it may include suggestions for permissions that could be granted to avoid repeated prompts for similar actions. The format varies based on the suggestion type:
setMode:{"type": "setMode", "mode": "acceptEdits", "destination": "session"}addRules:{"type": "addRules", "rules": [...], "behavior": "allow", "destination": "session"}
Use the helper methods to access common fields.
Fields§
§suggestion_type: PermissionTypeThe type of suggestion (e.g., setMode, addRules)
destination: PermissionDestinationWhere to apply this permission (e.g., session, project)
mode: Option<PermissionModeName>The permission mode (for setMode type)
behavior: Option<PermissionBehavior>The behavior (for addRules type, e.g., allow)
rules: Option<Vec<Value>>The rules to add (for addRules type)
Trait Implementations§
Source§impl Clone for PermissionSuggestion
impl Clone for PermissionSuggestion
Source§fn clone(&self) -> PermissionSuggestion
fn clone(&self) -> PermissionSuggestion
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 moreSource§impl Debug for PermissionSuggestion
impl Debug for PermissionSuggestion
Source§impl<'de> Deserialize<'de> for PermissionSuggestion
impl<'de> Deserialize<'de> for PermissionSuggestion
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 PermissionSuggestion
impl PartialEq for PermissionSuggestion
Source§impl Serialize for PermissionSuggestion
impl Serialize for PermissionSuggestion
impl StructuralPartialEq for PermissionSuggestion
Auto Trait Implementations§
impl Freeze for PermissionSuggestion
impl RefUnwindSafe for PermissionSuggestion
impl Send for PermissionSuggestion
impl Sync for PermissionSuggestion
impl Unpin for PermissionSuggestion
impl UnsafeUnpin for PermissionSuggestion
impl UnwindSafe for PermissionSuggestion
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