[][src]Struct pear::input::Text

pub struct Text<'a> { /* fields omitted */ }

Trait Implementations

impl<'a> Debug for Text<'a>[src]

impl<'a> From<&'a str> for Text<'a>[src]

impl<'a> Input for Text<'a>[src]

type Token = char

type Slice = &'a str

type Many = Self::Slice

type Marker = usize

type Context = Span<'a>

fn token(&mut self) -> Option<Self::Token>[src]

Returns a copy of the current token, if there is one.

fn slice(&mut self, n: usize) -> Option<Self::Slice>[src]

Returns a copy of the current slice of size n, if there is one.

fn peek<F>(&mut self, cond: F) -> bool where
    F: FnMut(&Self::Token) -> bool
[src]

Checks if the current token fulfills cond.

fn peek_slice<F>(&mut self, n: usize, cond: F) -> bool where
    F: FnMut(&Self::Slice) -> bool
[src]

Checks if the current slice of size n (if any) fulfills cond.

fn eat<F>(&mut self, cond: F) -> Option<Self::Token> where
    F: FnMut(&Self::Token) -> bool
[src]

Checks if the current token fulfills cond. If so, the token is consumed and returned. Otherwise, returns None.

fn eat_slice<F>(&mut self, n: usize, cond: F) -> Option<Self::Slice> where
    F: FnMut(&Self::Slice) -> bool
[src]

Checks if the current slice of size n (if any) fulfills cond. If so, the slice is consumed and returned. Otherwise, returns None.

fn take<F>(&mut self, cond: F) -> Self::Many where
    F: FnMut(&Self::Token) -> bool
[src]

Takes tokens while cond returns true, collecting them into a Self::Many and returning it.

fn skip<F>(&mut self, cond: F) -> usize where
    F: FnMut(&Self::Token) -> bool
[src]

Skips tokens while cond returns true. Returns the number of skipped tokens.

fn has(&mut self, n: usize) -> bool[src]

Returns true if there are at least n tokens remaining.

impl<'_> Rewind for Text<'_>[src]

Auto Trait Implementations

impl<'a> RefUnwindSafe for Text<'a>

impl<'a> Send for Text<'a>

impl<'a> Sync for Text<'a>

impl<'a> Unpin for Text<'a>

impl<'a> UnwindSafe for Text<'a>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.