Struct ParseStr

Source
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>

Source

pub fn new(input: &'a str) -> Self

Source

pub fn starts_with_str(&self, s: &str) -> bool

Source

pub const fn rest(&self) -> &'a str

Source

pub fn read_until_inclusive( &mut self, pred: impl FnMut(char) -> bool, ) -> &'a str

Source

pub fn drop_prefix(&mut self, s: &str) -> bool

Source

pub fn preview_until_with_brackets<const OPEN: char, const CLOSE: char>( &self, pred: impl FnMut(char) -> bool, ) -> &'a str

Source

pub fn read_until_escaped(&mut self, find: char, escape: char) -> &'a str

Sourceยง

impl ParseStr<'_, ByteOffset>

Source

pub fn offset(&mut self) -> &mut ByteOffset

Trait Implementationsยง

Sourceยง

impl<'a, P: SourcePos + 'a> ParseSource<'a> for ParseStr<'a, P>

Sourceยง

type Pos = P

Sourceยง

type Str = &'a str

Sourceยง

type Source = &'a str

Sourceยง

fn source(&self) -> &Self::Source

Sourceยง

fn curr_pos(&self) -> P

Sourceยง

fn pop_head(&mut self) -> Option<char>

Sourceยง

fn read_until_line_end(&mut self) -> (&'a str, P)

Sourceยง

fn trim_start(&mut self)

Sourceยง

fn starts_with(&mut self, c: char) -> bool

Sourceยง

fn read_while(&mut self, pred: impl FnMut(char) -> bool) -> Self::Str

Sourceยง

fn read_until_with_brackets<const OPEN: char, const CLOSE: char>( &mut self, pred: impl FnMut(char) -> bool, ) -> Self::Str

Sourceยง

fn peek_head(&mut self) -> Option<char>

Sourceยง

fn read_n(&mut self, i: usize) -> Self::Str

Sourceยง

fn read_until_str(&mut self, s: &str) -> Self::Str

Sourceยง

fn skip(&mut self, i: usize)

Sourceยง

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ยง

Sourceยง

impl<T> Any for T
where T: 'static + ?Sized,

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
ยง

impl<T> ArchivePointee for T

ยง

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
ยง

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
Sourceยง

impl<T> Borrow<T> for T
where T: ?Sized,

Sourceยง

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Sourceยง

impl<T> BorrowMut<T> for T
where T: ?Sized,

Sourceยง

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
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

ยง

fn deserialize( &self, deserializer: &mut D, ) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Sourceยง

impl<T, U> Into<U> for T
where U: From<T>,

Sourceยง

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Sourceยง

impl<T> IntoEither for T

Sourceยง

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 more
Sourceยง

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
ยง

impl<T> Pointable for T

ยง

const ALIGN: usize

The alignment of pointer.
ยง

type Init = T

The type for initializers.
ยง

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
ยง

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
ยง

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
ยง

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
ยง

impl<T> Pointee for T

ยง

type Metadata = ()

The type for metadata in pointers and references to Self.
Sourceยง

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Sourceยง

type Error = Infallible

The type returned in the event of a conversion error.
Sourceยง

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Sourceยง

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Sourceยง

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Sourceยง

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

impl<T> ErasedDestructor for T
where T: 'static,