pub struct ParseStr<'a, P: SourcePos> {
input: &'a str,
pub pos: P,
}
Fieldsยง
ยงinput: &'a str
ยงpos: P
Implementationsยง
Sourceยงimpl<'a, P: SourcePos> ParseStr<'a, P>
impl<'a, P: SourcePos> ParseStr<'a, P>
pub fn new(input: &'a str) -> Self
pub fn starts_with_str(&self, s: &str) -> bool
pub const fn rest(&self) -> &'a str
pub fn read_until_inclusive( &mut self, pred: impl FnMut(char) -> bool, ) -> &'a str
pub fn drop_prefix(&mut self, s: &str) -> bool
pub fn preview_until_with_brackets<const OPEN: char, const CLOSE: char>( &self, pred: impl FnMut(char) -> bool, ) -> &'a str
pub fn read_until_escaped(&mut self, find: char, escape: char) -> &'a str
Sourceยงimpl ParseStr<'_, ByteOffset>
impl ParseStr<'_, ByteOffset>
pub fn offset(&mut self) -> &mut ByteOffset
Trait Implementationsยง
Sourceยงimpl<'a, P: SourcePos + 'a> ParseSource<'a> for ParseStr<'a, P>
impl<'a, P: SourcePos + 'a> ParseSource<'a> for ParseStr<'a, P>
type Pos = P
type Str = &'a str
type Source = &'a str
fn source(&self) -> &Self::Source
fn curr_pos(&self) -> P
fn pop_head(&mut self) -> Option<char>
fn read_until_line_end(&mut self) -> (&'a str, P)
fn trim_start(&mut self)
fn starts_with(&mut self, c: char) -> bool
fn read_while(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str
fn read_until_with_brackets<const OPEN: char, const CLOSE: char>( &mut self, pred: impl FnMut(char) -> bool, ) -> Self::Str
fn peek_head(&mut self) -> Option<char>
fn read_n(&mut self, i: usize) -> Self::Str
fn read_until_str(&mut self, s: &str) -> Self::Str
fn skip(&mut self, i: usize)
fn read_until(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str
Auto Trait Implementationsยง
impl<'a, P> Freeze for ParseStr<'a, P>where
P: Freeze,
impl<'a, P> RefUnwindSafe for ParseStr<'a, P>where
P: RefUnwindSafe,
impl<'a, P> Send for ParseStr<'a, P>where
P: Send,
impl<'a, P> Sync for ParseStr<'a, P>where
P: Sync,
impl<'a, P> Unpin for ParseStr<'a, P>where
P: Unpin,
impl<'a, P> UnwindSafe for ParseStr<'a, P>where
P: UnwindSafe,
Blanket Implementationsยง
ยงimpl<T> ArchivePointee for T
impl<T> ArchivePointee for T
ยงtype ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
ยงfn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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
ยงimpl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
ยงfn deserialize(
&self,
deserializer: &mut D,
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
ยงimpl<T> Instrument for T
impl<T> Instrument for T
ยงfn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
ยงfn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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