pub struct Allowlist { /* private fields */ }Expand description
An ordered collection of rules. Rules are matched in order; the first match wins (used to surface which rule allowed a command).
Implementations§
Source§impl Allowlist
impl Allowlist
pub fn new() -> Self
pub fn from_rules(rules: Vec<Rule>) -> Self
pub fn push(&mut self, rule: Rule)
pub fn extend(&mut self, other: Allowlist)
pub fn rules(&self) -> &[Rule]
Sourcepub fn find_match(&self, cmd: &[String]) -> Option<&Rule>
pub fn find_match(&self, cmd: &[String]) -> Option<&Rule>
Return the first rule that matches, or None if the command is denied.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Allowlist
impl RefUnwindSafe for Allowlist
impl Send for Allowlist
impl Sync for Allowlist
impl Unpin for Allowlist
impl UnsafeUnpin for Allowlist
impl UnwindSafe for Allowlist
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