pub struct CompiledRules {
pub file: RulesFile,
/* private fields */
}Expand description
A RulesFile with all glob patterns compiled.
Fields§
§file: RulesFileImplementations§
Source§impl CompiledRules
impl CompiledRules
Sourcepub fn compile(file: RulesFile) -> Result<Self>
pub fn compile(file: RulesFile) -> Result<Self>
Compile all glob patterns in file.
Fails on unsupported versions and invalid glob patterns.
Sourcepub fn layer_of(&self, path: &str) -> Option<&str>
pub fn layer_of(&self, path: &str) -> Option<&str>
The layer path belongs to, or None if it matches no layer.
Self::validate guarantees indexed files match at most one layer.
Sourcepub fn layers_of(&self, path: &str) -> Vec<&str>
pub fn layers_of(&self, path: &str) -> Vec<&str>
All layers path belongs to (used for overlap detection).
Sourcepub fn validate(&self, indexed_files: &[String]) -> Result<()>
pub fn validate(&self, indexed_files: &[String]) -> Result<()>
Validate the rules against the set of indexed files.
Errors on:
- rules referencing undeclared layer names
- an indexed file matching two or more layers
metric = "file_symbols"combined withscope = "symbol"
Sourcepub fn limit_exclude(&self, i: usize) -> &GlobSet
pub fn limit_exclude(&self, i: usize) -> &GlobSet
Compiled exclude globset for file.rules.limit[i].
Sourcepub fn frozen_path(&self, i: usize) -> &GlobSet
pub fn frozen_path(&self, i: usize) -> &GlobSet
Compiled paths globset for file.rules.no_new_dependents[i].
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledRules
impl RefUnwindSafe for CompiledRules
impl Send for CompiledRules
impl Sync for CompiledRules
impl Unpin for CompiledRules
impl UnsafeUnpin for CompiledRules
impl UnwindSafe for CompiledRules
Blanket Implementations§
impl<T> Allocation for T
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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 more