pub struct SectionCheck {
pub pattern: String,
pub file: Option<String>,
pub roots: Vec<String>,
pub must_match: Option<String>,
pub scope: CheckScope,
pub message: Option<String>,
}Expand description
A universal, config-driven content check attached to a section. pattern
parses a line into named capture groups; file (a group name) and/or
must_match (a regex built from ${group} substitutions) then assert the
captured reference points at something real.
Fields§
§pattern: StringRegex parsing one line into named groups. A line that does not match is prose (skipped); a match is validated.
file: Option<String>Optional capture-group name holding a file path to open (resolved against
roots). Its presence is what makes the check file-scoped vs corpus-wide.
roots: Vec<String>Directories the file path / corpus resolve against (project-root
relative). Defaults to ["."].
must_match: Option<String>Optional regex that must match in the opened file (or, when file is
unset, in the concatenated corpus under roots). ${group} is replaced
by the regex-escaped capture from pattern.
scope: CheckScopeWhich lines to validate. Defaults to all.
message: Option<String>Optional custom failure message; ${group} is replaced by the raw
capture from pattern.
Trait Implementations§
Source§impl Clone for SectionCheck
impl Clone for SectionCheck
Source§fn clone(&self) -> SectionCheck
fn clone(&self) -> SectionCheck
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SectionCheck
impl Debug for SectionCheck
Source§impl<'de> Deserialize<'de> for SectionCheck
impl<'de> Deserialize<'de> for SectionCheck
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Auto Trait Implementations§
impl Freeze for SectionCheck
impl RefUnwindSafe for SectionCheck
impl Send for SectionCheck
impl Sync for SectionCheck
impl Unpin for SectionCheck
impl UnsafeUnpin for SectionCheck
impl UnwindSafe for SectionCheck
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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>
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>
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