pub struct RequiredPatternRule { /* private fields */ }Expand description
Ensures that files matching a glob contain a required pattern.
If a file matches the glob but does NOT contain the pattern, a violation is emitted. Useful for enforcing conventions like “all page components must have an ErrorBoundary” or “all API routes must validate input”.
Optionally supports a condition_pattern: the required pattern is only
enforced if the condition pattern is present in the file.
Implementations§
Source§impl RequiredPatternRule
impl RequiredPatternRule
pub fn new(config: &RuleConfig) -> Result<Self, RuleBuildError>
Trait Implementations§
Source§impl Debug for RequiredPatternRule
impl Debug for RequiredPatternRule
Source§impl Rule for RequiredPatternRule
impl Rule for RequiredPatternRule
Auto Trait Implementations§
impl Freeze for RequiredPatternRule
impl RefUnwindSafe for RequiredPatternRule
impl Send for RequiredPatternRule
impl Sync for RequiredPatternRule
impl Unpin for RequiredPatternRule
impl UnsafeUnpin for RequiredPatternRule
impl UnwindSafe for RequiredPatternRule
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> 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