#[non_exhaustive]pub enum Selector {
Wildcard,
Entry(EntryType),
Neg(Box<Self>),
Binding(String, Box<Self>),
Attr(Box<Self>, Vec<String>),
Alt(Vec<Self>),
Multi(Vec<Self>),
Ancestrage(Box<Self>, Box<Self>),
}
Expand description
A selector used to filter bibliographies and match on entries.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
Wildcard
A wildcard selector: *
.
Entry(EntryType)
An entry type literal: report
.
Neg(Box<Self>)
A negation: !x
.
Binding(String, Box<Self>)
A binding: x:misc
.
Attr(Box<Self>, Vec<String>)
An attribute filtering: abc[att1, attr2]
.
Alt(Vec<Self>)
An alternate selector: a | b
.
Multi(Vec<Self>)
A multi-parent selector: a & b
.
Ancestrage(Box<Self>, Box<Self>)
An ancestrage selector: a > b
.
Implementations§
source§impl Selector
impl Selector
sourcepub fn parse(src: &str) -> Result<Self, SelectorError>
pub fn parse(src: &str) -> Result<Self, SelectorError>
Parse a selector from a string.
sourcepub fn matches(&self, entry: &Entry) -> bool
pub fn matches(&self, entry: &Entry) -> bool
Checks if the selector matches the provided Entry
.
Trait Implementations§
source§impl PartialEq for Selector
impl PartialEq for Selector
impl Eq for Selector
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnwindSafe for Selector
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.