pub struct TokenStream<'t> { /* private fields */ }

Implementations§

source§

impl<'t> TokenStream<'t>

source

pub fn iter(&self) -> TokenStreamIterator<'_>

source

pub const fn new(slice: &'t [TokenMatch<'t>]) -> Self

source

pub fn into_token_match(self) -> Option<TokenMatch<'t>>

source

pub fn as_token_vec(&self) -> Vec<&Token<'_>>

Trait Implementations§

source§

impl<'t> Clone for TokenStream<'t>

source§

fn clone(&self) -> TokenStream<'t>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'t> Debug for TokenStream<'t>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Display for TokenStream<'_>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'t> InputIter for TokenStream<'t>

§

type Item = TokenMatch<'t>

The current input type is a sequence of that Item type. Read more
§

type Iter = TokenStreamIndices<'t>

An iterator over the input type, producing the item and its position for use with Slice. If we’re iterating over &str, the position corresponds to the byte index of the character
§

type IterElem = TokenStreamIterator<'t>

An iterator over the input type, producing the item
source§

fn iter_indices(&self) -> Self::Iter

Returns an iterator over the elements and their byte offsets
source§

fn iter_elements(&self) -> Self::IterElem

Returns an iterator over the elements
source§

fn position<P>(&self, predicate: P) -> Option<usize>
where P: Fn(Self::Item) -> bool,

Finds the byte position of the element
source§

fn slice_index(&self, count: usize) -> Result<usize, Needed>

Get the byte offset from the element’s position in the stream
source§

impl<'t> InputLength for TokenStream<'t>

source§

fn input_len(&self) -> usize

Calculates the input length, as indicated by its name, and the name of the trait itself
source§

impl<'t> InputTake for TokenStream<'t>

source§

fn take(&self, count: usize) -> Self

Returns a slice of count bytes. panics if count > length
source§

fn take_split(&self, count: usize) -> (Self, Self)

Split the stream at the count byte offset. panics if count > length
source§

impl<'t> RecreateContext<TokenStream<'t>> for CodePoint

source§

fn recreate_context( original_input: TokenStream<'t>, tail: TokenStream<'t> ) -> Self

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
source§

impl<'t> UnspecializedInput for TokenStream<'t>

Auto Trait Implementations§

§

impl<'t> Freeze for TokenStream<'t>

§

impl<'t> RefUnwindSafe for TokenStream<'t>

§

impl<'t> Send for TokenStream<'t>

§

impl<'t> Sync for TokenStream<'t>

§

impl<'t> Unpin for TokenStream<'t>

§

impl<'t> UnwindSafe for TokenStream<'t>

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
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
source§

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

source§

fn try_as(self) -> Option<U>

source§

impl<T, U> ConvertibleToMut<U> for T

source§

fn try_as_mut(&mut self) -> Option<&mut U>

source§

impl<T, U> ConvertibleToRef<U> for T
where &'a U: for<'a> TryFrom<&'a T>,

source§

impl<I, T> ExtractContext<I, ()> for T

source§

fn extract_context(self, _original_input: I)

Given the context attached to a nom error, and given the original input to the nom parser, extract more the useful context information. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Indentable for T
where T: Display,

source§

fn indented(self, indent: &str) -> Indented<'_, Self>

Wrap this object so that its Display representation is indented with the given indent. Each non-empty line of the formatted output will be prefixed with the indent. Read more
source§

fn indented_skip_initial(self, indent: &str) -> IndentedSkipIntial<'_, Self>

Wrap this object so that its Display representation is indented with the given indent. Each non-empty line except for the first of the formatted output will be prefixed with the indent. Read more
source§

impl<T> InputTakeAtPosition for T

§

type Item = <T as InputIter>::Item

The current input type is a sequence of that Item type. Read more
source§

fn split_at_position<P, E>(&self, predicate: P) -> Result<(T, T), Err<E>>
where E: ParseError<T>, P: Fn(<T as InputTakeAtPosition>::Item) -> bool,

Looks for the first element of the input type for which the condition returns true, and returns the input up to this position. Read more
source§

fn split_at_position1<P, E>( &self, predicate: P, e: ErrorKind ) -> Result<(T, T), Err<E>>
where E: ParseError<T>, P: Fn(<T as InputTakeAtPosition>::Item) -> bool,

Looks for the first element of the input type for which the condition returns true and returns the input up to this position. Read more
source§

fn split_at_position_complete<P, E>( &self, predicate: P ) -> Result<(T, T), Err<E>>
where E: ParseError<T>, P: Fn(<T as InputTakeAtPosition>::Item) -> bool,

Looks for the first element of the input type for which the condition returns true, and returns the input up to this position. Read more
source§

fn split_at_position1_complete<P, E>( &self, predicate: P, e: ErrorKind ) -> Result<(T, T), Err<E>>
where E: ParseError<T>, P: Fn(<T as InputTakeAtPosition>::Item) -> bool,

Looks for the first element of the input type for which the condition returns true and returns the input up to this position. Read more
source§

impl<T> Instrument for T

source§

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

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

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<I> RecreateContext<I> for I

source§

fn recreate_context(_original_input: I, tail: I) -> I

Given the original input, as well as the context reported by nom, recreate a context in the original string where the error occurred. Read more
source§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for T
where T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

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

§

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

§

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.
source§

impl<T> WithSubscriber for T

source§

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
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

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