pub struct DirContainsRule { /* private fields */ }Trait Implementations§
Source§impl Debug for DirContainsRule
impl Debug for DirContainsRule
Source§impl Rule for DirContainsRule
impl Rule for DirContainsRule
fn id(&self) -> &str
fn level(&self) -> Level
fn policy_url(&self) -> Option<&str>
Source§fn requires_full_index(&self) -> bool
fn requires_full_index(&self) -> bool
fn evaluate(&self, ctx: &Context<'_>) -> Result<Vec<Violation>>
Source§fn git_tracked_mode(&self) -> GitTrackedMode
fn git_tracked_mode(&self) -> GitTrackedMode
Whether (and how) this rule narrows its iteration to
git-tracked entries. Default
GitTrackedMode::Off.
Rule kinds that support git_tracked_only: override to
return GitTrackedMode::FileOnly (file-mode rules:
check set.contains(path)) or GitTrackedMode::DirAware
(dir-mode rules: check dir_has_tracked_files(path, set))
when the user opts in. Read moreSource§fn wants_git_blame(&self) -> bool
fn wants_git_blame(&self) -> bool
Whether this rule needs
git blame output on
Context. Default false; the git_blame_age rule
kind overrides to return true. The engine builds the
shared crate::git::BlameCache once per run when any
rule opts in, so multiple blame-aware rules over
overlapping paths: re-use the parsed result.Source§fn path_scope(&self) -> Option<&Scope>
fn path_scope(&self) -> Option<&Scope>
Source§fn fixer(&self) -> Option<&dyn Fixer>
fn fixer(&self) -> Option<&dyn Fixer>
Optional automatic-fix strategy. Rules whose violations can be
mechanically corrected (e.g. creating a missing file, removing a
forbidden one, renaming to the correct case) return a
Fixer here; the default implementation reports the rule as
unfixable.Source§fn as_per_file(&self) -> Option<&dyn PerFileRule>
fn as_per_file(&self) -> Option<&dyn PerFileRule>
Opt into the file-major dispatch path. Per-file rules that
can evaluate one file at a time given a pre-loaded byte
slice override this to return
Some(self); cross-file
rules and any rule with requires_full_index() == true
leave it as None and keep evaluating under the rule-
major loop. Read moreAuto Trait Implementations§
impl Freeze for DirContainsRule
impl RefUnwindSafe for DirContainsRule
impl Send for DirContainsRule
impl Sync for DirContainsRule
impl Unpin for DirContainsRule
impl UnsafeUnpin for DirContainsRule
impl UnwindSafe for DirContainsRule
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
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