pub enum Selector {
All,
LineNumbers(Vec<LineSpec>),
Positions(Vec<Position>),
}Expand description
A selector specifying which lines/positions to extract.
Variants§
All
Select all lines (no selector provided).
LineNumbers(Vec<LineSpec>)
Select specific line numbers and/or ranges.
Positions(Vec<Position>)
Select specific positions (line:column).
Implementations§
Source§impl Selector
impl Selector
Sourcepub fn parse(s: &str) -> Result<Self>
pub fn parse(s: &str) -> Result<Self>
Parse a selector string.
§Examples
use sel::selector::Selector;
let sel = Selector::parse("42").unwrap();
let sel = Selector::parse("10-20").unwrap();
let sel = Selector::parse("1,5,10-15").unwrap();
let sel = Selector::parse("23:260").unwrap();Sourcepub fn is_positional(&self) -> bool
pub fn is_positional(&self) -> bool
Returns true if this is a positional selector.
Trait Implementations§
impl Eq for Selector
impl StructuralPartialEq for Selector
Auto Trait Implementations§
impl Freeze for Selector
impl RefUnwindSafe for Selector
impl Send for Selector
impl Sync for Selector
impl Unpin for Selector
impl UnsafeUnpin 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