pub struct RefSelector { /* private fields */ }Expand description
A list of positive and negative RefPatterns.
An entry is a pattern with an optional first !, which makes it negative.
A name is selected when the list has no positive pattern or a positive
pattern matches it, and no negative pattern matches it. The order of the
entries has no effect, and an empty list selects each name.
Implementations§
Source§impl RefSelector
impl RefSelector
Sourcepub fn parse<'a>(
entries: impl IntoIterator<Item = &'a str>,
) -> Result<RefSelector>
pub fn parse<'a>( entries: impl IntoIterator<Item = &'a str>, ) -> Result<RefSelector>
Parses a list of entries. An entry is a pattern with an optional first
!. The selector keeps the entries in their order, with repeats.
§Errors
Error::InvalidRefPatternif an entry is not valid. The text names the entry with its!.
Sourcepub fn matches(&self, name: &str) -> bool
pub fn matches(&self, name: &str) -> bool
Returns true if the selector selects name.
The name is not checked against the ref-name rule.
Sourcepub fn positive(&self) -> &[RefPattern]
pub fn positive(&self) -> &[RefPattern]
Returns the positive patterns in entry order.
Sourcepub fn negative(&self) -> &[RefPattern]
pub fn negative(&self) -> &[RefPattern]
Returns the negative patterns in entry order, with the ! removed.
Trait Implementations§
Source§impl Clone for RefSelector
impl Clone for RefSelector
Source§impl Debug for RefSelector
impl Debug for RefSelector
impl Eq for RefSelector
Source§impl PartialEq for RefSelector
impl PartialEq for RefSelector
impl StructuralPartialEq for RefSelector
Auto Trait Implementations§
impl Freeze for RefSelector
impl RefUnwindSafe for RefSelector
impl Send for RefSelector
impl Sync for RefSelector
impl Unpin for RefSelector
impl UnsafeUnpin for RefSelector
impl UnwindSafe for RefSelector
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