pub enum RuleBody {
Tool(RuleDecision),
Args(Vec<ArgRule>),
}Expand description
What a tool-glob key maps to.
Why: read_file: allow (the whole tool) and bash: { "rm *": deny } (one
tool, discriminated by its subject) need different precedence tiers — see
crate::permissions::matcher.
What: Tool is one decision for every call of the matching tools; Args
is a set of subject globs, each with its own decision. An Args body that
matches no subject contributes nothing.
Test: tool_level_string_and_arg_level_table_both_parse.
Variants§
Tool(RuleDecision)
Args(Vec<ArgRule>)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RuleBody
impl RefUnwindSafe for RuleBody
impl Send for RuleBody
impl Sync for RuleBody
impl Unpin for RuleBody
impl UnsafeUnpin for RuleBody
impl UnwindSafe for RuleBody
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,
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 moreCreates a shared type from an unshared type.