pub struct Policy { /* private fields */ }Expand description
Execution policy containing rules for command authorization.
Implementations§
Source§impl Policy
impl Policy
Sourcepub fn add_prefix_rule(
&mut self,
pattern: &[String],
decision: Decision,
) -> Result<()>
pub fn add_prefix_rule( &mut self, pattern: &[String], decision: Decision, ) -> Result<()>
Add a prefix rule to the policy.
Sourcepub fn check(&self, command: &[String]) -> RuleMatch
pub fn check(&self, command: &[String]) -> RuleMatch
Check a single command against the policy.
Sourcepub fn check_multiple<'a, I, F>(
&self,
commands: I,
heuristics_fallback: &F,
) -> PolicyEvaluation
pub fn check_multiple<'a, I, F>( &self, commands: I, heuristics_fallback: &F, ) -> PolicyEvaluation
Check multiple commands against the policy.
Sourcepub fn prefix_rules(&self) -> &[PrefixRule]
pub fn prefix_rules(&self) -> &[PrefixRule]
Get all prefix rules.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Policy
impl RefUnwindSafe for Policy
impl Send for Policy
impl Sync for Policy
impl Unpin for Policy
impl UnsafeUnpin for Policy
impl UnwindSafe for Policy
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