Struct GroupMap
pub struct GroupMap {
pub rules: Vec<GroupRule>,
pub strict: bool,
}Expand description
Compiled set of grouping rules. Built once per run from Options.group_file.
Fields§
§rules: Vec<GroupRule>§strict: boolImplementations§
§impl GroupMap
impl GroupMap
pub fn from_file(path: &Path, strict: bool) -> Result<Self, GroupParseError>
pub fn from_file(path: &Path, strict: bool) -> Result<Self, GroupParseError>
Read <repo_root>/<file> (or any absolute path) and parse it.
Strict mode is supplied separately from the Options.strict_grouping
field; the file format doesn’t carry it.
§Errors
Returns GroupParseError on I/O failure, missing separator, empty
pattern/name, or invalid regex.
pub fn parse(text: &str, strict: bool) -> Result<Self, GroupParseError>
pub fn parse(text: &str, strict: bool) -> Result<Self, GroupParseError>
Parse the group-file text format.
Lines:
- Blank lines are skipped.
#-prefix lines are treated as comments and skipped.- Other lines must contain
=>separating LHS from RHS. - LHS leading
^→ treat as full regex (with lookaround support). - LHS without
^→ escape as literal, prefix-anchor + trailing slash:src/foo→^src/foo/so it matchessrc/foo/bar.rsbut notsrc/foobar.rs.
§Errors
See GroupParseError.
pub fn map_entity(&self, path: &str) -> Option<&str>
pub fn map_entity(&self, path: &str) -> Option<&str>
First-match-wins lookup. Returns the logical group name for the path
or None if no rule matches.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for GroupMap
impl RefUnwindSafe for GroupMap
impl Send for GroupMap
impl Sync for GroupMap
impl Unpin for GroupMap
impl UnsafeUnpin for GroupMap
impl UnwindSafe for GroupMap
Blanket Implementations§
impl<T> Allocation for T
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