pub struct StrSource<'s> {
source: &'s str,
remainder: &'s str,
}
Fields§
§source: &'s str
The full source string
remainder: &'s str
The remainder of the input which has not been tokenized yet
Implementations§
Trait Implementations§
Source§impl<'s> Source for StrSource<'s>
impl<'s> Source for StrSource<'s>
type Char = char
type String = &'s str
type Error = Infallible
Source§fn next_index(&self) -> usize
fn next_index(&self) -> usize
Returns the start index of the next character.
fn is_empty(&self) -> bool
Source§fn advance_while(
&mut self,
predicate: impl FnMut(char) -> bool,
) -> Result<&'s str, Infallible>
fn advance_while( &mut self, predicate: impl FnMut(char) -> bool, ) -> Result<&'s str, Infallible>
Advances in the input as long as the character matches the predicate, returning the
matching string.
Auto Trait Implementations§
impl<'s> Freeze for StrSource<'s>
impl<'s> RefUnwindSafe for StrSource<'s>
impl<'s> Send for StrSource<'s>
impl<'s> Sync for StrSource<'s>
impl<'s> Unpin for StrSource<'s>
impl<'s> UnwindSafe for StrSource<'s>
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<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more