pub struct CompiledGates { /* private fields */ }Expand description
Gates compiled for repeated evaluation.
Implementations§
Source§impl CompiledGates
impl CompiledGates
Sourcepub fn admits_path(&self, path: &FilePath) -> bool
pub fn admits_path(&self, path: &FilePath) -> bool
Whether this rule could match anything in a file at this path.
Costs no file read, so it runs first.
Sourcepub fn admits_content(&self, bytes: &[u8]) -> bool
pub fn admits_content(&self, bytes: &[u8]) -> bool
Whether this rule could match anything in these bytes.
Costs one read and a substring scan, and saves a parse. memchr’s searcher is used
rather than a naive scan because this runs once per rule per file, and a file that
no rule admits is the case worth making cheap.
Sourcepub fn has_content_gates(&self) -> bool
pub fn has_content_gates(&self) -> bool
Whether any content gate is declared, so a caller can skip reading when none is.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledGates
impl RefUnwindSafe for CompiledGates
impl Send for CompiledGates
impl Sync for CompiledGates
impl Unpin for CompiledGates
impl UnsafeUnpin for CompiledGates
impl UnwindSafe for CompiledGates
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