pub struct AskOnceApprovalChecker { /* private fields */ }Expand description
AskOnce policy — prompts once per tool name, remembers decisions.
After approving/denying a tool once, subsequent calls to the same tool use the cached decision without prompting again.
Implementations§
Source§impl AskOnceApprovalChecker
impl AskOnceApprovalChecker
Sourcepub fn new(prompter: Arc<dyn ApprovalPrompter>, timeout_seconds: u64) -> Self
pub fn new(prompter: Arc<dyn ApprovalPrompter>, timeout_seconds: u64) -> Self
Create a new AskOnceApprovalChecker with the given prompter and timeout.
Sourcepub fn cli_default() -> Self
pub fn cli_default() -> Self
Create with CLI prompter and default 5-minute timeout.
Sourcepub async fn clear_decisions(&self)
pub async fn clear_decisions(&self)
Clear all cached decisions.
Sourcepub async fn pre_approve(&self, tool_name: &str)
pub async fn pre_approve(&self, tool_name: &str)
Pre-approve a tool (useful for allowing known-safe tools).
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for AskOnceApprovalChecker
impl !RefUnwindSafe for AskOnceApprovalChecker
impl Send for AskOnceApprovalChecker
impl Sync for AskOnceApprovalChecker
impl Unpin for AskOnceApprovalChecker
impl UnsafeUnpin for AskOnceApprovalChecker
impl !UnwindSafe for AskOnceApprovalChecker
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