Skip to main content

TokenStream

Struct TokenStream 

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

Implementations§

Source§

impl<'t> TokenStream<'t>

Source

pub fn new(source: &'t str) -> Result<Self, ParseError<LineCol>>

Trait Implementations§

Source§

impl Parse for TokenStream<'_>

Source§

impl<'input> ParseElem<'input> for TokenStream<'input>

Source§

type Element = &'input Token<'input>

Type of a single atomic element of the input, for example a character or token
Source§

fn parse_elem(&'input self, pos: usize) -> RuleResult<Self::Element>

Get the element at pos, or Failed if past end of input.
Source§

impl<'input> ParseLiteral for TokenStream<'input>

Source§

fn parse_string_literal(&self, pos: usize, literal: &str) -> RuleResult<()>

Attempt to match the literal string at pos, returning whether it matched or failed.
Source§

impl<'input> ParseSlice<'input> for TokenStream<'input>

Source§

type Slice = &'input [PositionedToken<'input>]

Type of a slice of the input.
Source§

fn parse_slice(&'input self, p1: usize, p2: usize) -> Self::Slice

Get a slice of input.

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> UnsafeUnpin 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<'a, T, E> AsTaggedExplicit<'a, E> for T
where T: 'a,

Source§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

Source§

impl<'a, T, E> AsTaggedImplicit<'a, E> for T
where T: 'a,

Source§

fn implicit( self, class: Class, constructed: bool, tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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