pub struct Captures<'a>(/* private fields */);Expand description
See examples in the top-level documentation
Implementations§
Source§impl<'a> Captures<'a>
impl<'a> Captures<'a>
Sourcepub fn new<'b: 'a>(regex: &'a Regex, s: &'b str) -> Result<Captures<'a>>
pub fn new<'b: 'a>(regex: &'a Regex, s: &'b str) -> Result<Captures<'a>>
Collect captures on a regex
Sourcepub fn get<A: From<&'a str>>(&'a self, n: usize) -> Result<A>
pub fn get<A: From<&'a str>>(&'a self, n: usize) -> Result<A>
Convert a numeric capture group using From<&str>.
Sourcepub fn parse_get<A>(&'a self, n: usize) -> Result<A>
pub fn parse_get<A>(&'a self, n: usize) -> Result<A>
Attempt parsing a numeric capture group using FromStr.
Sourcepub fn try_get<A>(&'a self, n: usize) -> Result<A>
pub fn try_get<A>(&'a self, n: usize) -> Result<A>
Try converting a numeric capture group using TryFrom<&str>.
Sourcepub fn name<'b, A: From<&'a str>>(&'a self, name: &'b str) -> Result<A>
pub fn name<'b, A: From<&'a str>>(&'a self, name: &'b str) -> Result<A>
Convert a named capture group using From<&str>.
Sourcepub fn parse_name<'b, A>(&'a self, name: &'b str) -> Result<A>
pub fn parse_name<'b, A>(&'a self, name: &'b str) -> Result<A>
Attempt parsing a named capture group using FromStr.
Auto Trait Implementations§
impl<'a> Freeze for Captures<'a>
impl<'a> RefUnwindSafe for Captures<'a>
impl<'a> Send for Captures<'a>
impl<'a> Sync for Captures<'a>
impl<'a> Unpin for Captures<'a>
impl<'a> UnwindSafe for Captures<'a>
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