pub struct PermissionStore { /* private fields */ }Expand description
Stores per-tool permission overrides and session-level grants.
Implementations§
Source§impl PermissionStore
impl PermissionStore
pub fn new() -> Self
Sourcepub fn check(
&self,
tool_name: &str,
approval: &ApprovalRequirement,
) -> PermissionDecision
pub fn check( &self, tool_name: &str, approval: &ApprovalRequirement, ) -> PermissionDecision
Check whether a tool call should be auto-approved, needs asking, or denied.
Sourcepub fn grant_session(&mut self, tool_name: &str)
pub fn grant_session(&mut self, tool_name: &str)
Grant session-level permission for a tool (user pressed [A]).
Sourcepub fn set_override(&mut self, tool_name: &str, level: PermissionLevel)
pub fn set_override(&mut self, tool_name: &str, level: PermissionLevel)
Set an explicit override level for a tool.
Auto Trait Implementations§
impl Freeze for PermissionStore
impl RefUnwindSafe for PermissionStore
impl Send for PermissionStore
impl Sync for PermissionStore
impl Unpin for PermissionStore
impl UnsafeUnpin for PermissionStore
impl UnwindSafe for PermissionStore
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more