pub struct Rule { /* private fields */ }Expand description
A single allowlist entry, parsed once and matched many times.
Implementations§
Source§impl Rule
impl Rule
Sourcepub fn parse(
raw: impl Into<String>,
source: impl Into<String>,
) -> Result<Self, RuleError>
pub fn parse( raw: impl Into<String>, source: impl Into<String>, ) -> Result<Self, RuleError>
Parse a single allowlist entry like git log --oneline *.
Sourcepub fn matches(&self, cmd: &[String]) -> bool
pub fn matches(&self, cmd: &[String]) -> bool
True if every token in cmd is matched by the corresponding pattern.
pub fn raw(&self) -> &str
pub fn source(&self) -> &str
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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