Commit Graph

7 Commits

Author SHA1 Message Date
Wolfgang Bumiller
8e38a91c57 MatchEntry: also provide access to other parts
In the future we'll probably have a separate Builder type,
but that's an API change.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-20 12:37:05 +02:00
Wolfgang Bumiller
ed626f3831 MatchEntry: add mutable accessors
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-20 12:33:00 +02:00
Wolfgang Bumiller
e86ed76048 add MatchPattern::Literal
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-05-20 12:14:16 +02:00
Wolfgang Bumiller
e2255d72d1 Add MatchEntry::parse_pattern
This is a convenience helper to parse an entry with possible
inversion via a leading exclamation mark and interpreting
trailing slashes to mean `MatchFlag::MATCH_DIRECTORY` and
create a `Pattern` from the string with those characters
stripped off.

This also changes the way `MatchFlag`s are passed to a
builder pattern for convenience.

Also: impl std::ops::Not for MatchType.

Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-28 13:25:16 +02:00
Wolfgang Bumiller
b1a5365911 Pattern: strip triling slashes, forbid empty patterns
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-28 12:05:53 +02:00
Wolfgang Bumiller
96d7b7c74d MatchList::with_capacity and Into<Vec<MatchEntry>>
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
2020-04-27 16:54:38 +02:00
Wolfgang Bumiller
d5c0e44a9d initial import
Signed-off-by: Wolfgang Bumiller <w.bumiller@errno.eu>
2020-04-27 12:46:59 +02:00