pub struct ToolAskRule {
pub tool: String,
pub command: Option<String>,
pub path: Option<String>,
}Expand description
Typed rule that marks a tool invocation as requiring approval.
This foundation is intentionally ask-only. Existing trusted/denied command
prefix behavior is preserved while typed ask records can make
AskForApproval::Never reject invocations that cannot be approved.
Fields§
§tool: StringName of the tool this rule applies to (e.g. "exec_shell", "edit_file").
command: Option<String>Optional command prefix to match against (uses arity-aware matching).
path: Option<String>Optional file path pattern to match against.
Implementations§
Source§impl ToolAskRule
impl ToolAskRule
Sourcepub fn new(tool: impl Into<String>) -> ToolAskRule
pub fn new(tool: impl Into<String>) -> ToolAskRule
Creates a new ask rule matching any invocation of the given tool.
Sourcepub fn exec_shell(command: impl Into<String>) -> ToolAskRule
pub fn exec_shell(command: impl Into<String>) -> ToolAskRule
Creates an ask rule for exec_shell matching a specific command prefix.
Trait Implementations§
Source§impl Clone for ToolAskRule
impl Clone for ToolAskRule
Source§fn clone(&self) -> ToolAskRule
fn clone(&self) -> ToolAskRule
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 ToolAskRule
impl Debug for ToolAskRule
Source§impl<'de> Deserialize<'de> for ToolAskRule
impl<'de> Deserialize<'de> for ToolAskRule
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolAskRule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ToolAskRule, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for ToolAskRule
Source§impl PartialEq for ToolAskRule
impl PartialEq for ToolAskRule
Source§fn eq(&self, other: &ToolAskRule) -> bool
fn eq(&self, other: &ToolAskRule) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ToolAskRule
impl Serialize for ToolAskRule
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ToolAskRule
Auto Trait Implementations§
impl Freeze for ToolAskRule
impl RefUnwindSafe for ToolAskRule
impl Send for ToolAskRule
impl Sync for ToolAskRule
impl Unpin for ToolAskRule
impl UnsafeUnpin for ToolAskRule
impl UnwindSafe for ToolAskRule
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,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.