Struct expry::stringparser::StringParser
source · pub struct StringParser<'b> { /* private fields */ }
Implementations§
source§impl<'b> StringParser<'b>
impl<'b> StringParser<'b>
pub fn new(reader: &'b str) -> Self
pub fn accept<P: ParsePattern<'b>>(self, pattern: P) -> Self
pub fn accept_or_end<P: ParsePattern<'b>>(self, pattern: P) -> Self
pub fn accepts_or_end(self, s: &[&str]) -> Self
pub fn accepts(self, s: &[&str]) -> Self
pub fn span<P: ParsePattern<'b>>(self, pattern: P, min: usize) -> Self
pub fn span_max<P: ParsePattern<'b>>( self, pattern: P, min: usize, max: usize ) -> Self
pub fn spanner<S: Spanner>(self, spanner: &mut S) -> Self
sourcepub fn split<P: ParsePattern<'b>>(self, to: &mut &'b str, on: P) -> Self
pub fn split<P: ParsePattern<'b>>(self, to: &mut &'b str, on: P) -> Self
Split a string on on
, the matched()
will result in the part matching on
.
If needing a ‘split_or_end’ function, use a custom .spanner(..) or a lambda with
.span(..).matched(..)
pub fn search<P: ParsePattern<'b>>(self, on: P) -> Self
pub fn matched(self, to: &mut &'b str) -> Self
pub fn matched_parse<T: FromStr>(self, to: &mut T) -> Self
pub fn matched_fn<F: FnOnce(&'b str) -> bool>(self, to: F) -> Self
pub fn valid(self, reader: &mut &'b str) -> bool
pub fn unskip(self) -> Self
Auto Trait Implementations§
impl<'b> Freeze for StringParser<'b>
impl<'b> RefUnwindSafe for StringParser<'b>
impl<'b> Send for StringParser<'b>
impl<'b> Sync for StringParser<'b>
impl<'b> Unpin for StringParser<'b>
impl<'b> UnwindSafe for StringParser<'b>
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