Struct wax::CapturingToken
source · pub struct CapturingToken { /* private fields */ }
Expand description
Token that captures matched text in a glob expression.
Examples
CapturingToken
s can be used to isolate sub-expressions.
use wax::Glob;
let expression = "**/*.txt";
let glob = Glob::new(expression).unwrap();
for token in glob.captures() {
let (start, n) = token.span();
println!("capturing sub-expression: {}", &expression[start..][..n]);
}
Implementations§
source§impl CapturingToken
impl CapturingToken
sourcepub fn index(&self) -> usize
pub fn index(&self) -> usize
Gets the index of the capture.
Captures are one-indexed and the index zero always represents the implicit capture of the
complete match, so the index of CapturingToken
s is always one or greater. See
MatchedText
.
Trait Implementations§
source§impl Clone for CapturingToken
impl Clone for CapturingToken
source§fn clone(&self) -> CapturingToken
fn clone(&self) -> CapturingToken
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for CapturingToken
impl Debug for CapturingToken
impl Copy for CapturingToken
Auto Trait Implementations§
impl RefUnwindSafe for CapturingToken
impl Send for CapturingToken
impl Sync for CapturingToken
impl Unpin for CapturingToken
impl UnwindSafe for CapturingToken
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