Type Alias pear::input::Expected

source ·
pub type Expected<I> = Expected<<I as Input>::Token, <I as Input>::Slice>;

Aliased Type§

enum Expected<I> {
    Token(Option<InlinableString>, Option<<I as Input>::Token>),
    Slice(Option<InlinableString>, Option<<I as Input>::Slice>),
    Eof(Option<<I as Input>::Token>),
    Other(CowInlineString),
    Elided,
}

Variants§

§

Token(Option<InlinableString>, Option<<I as Input>::Token>)

§

Slice(Option<InlinableString>, Option<<I as Input>::Slice>)

§

Eof(Option<<I as Input>::Token>)

§

Other(CowInlineString)

§

Elided

Implementations§

source§

impl<Token, Slice> Expected<Token, Slice>

source

pub fn token<T: Show>(expected: Option<&T>, found: Option<Token>) -> Self

source

pub fn eof(found: Option<Token>) -> Self

source§

impl<Token, Slice> Expected<Token, Slice>

source

pub fn slice<S: Show>(expected: Option<&S>, found: Option<Slice>) -> Self

source§

impl<Token, Slice> Expected<Token, Slice>

source

pub fn map<FT, FS, T, S>(self, t: FT, s: FS) -> Expected<T, S>where FT: Fn(Token) -> T, FS: Fn(Slice) -> S,

source§

impl<T: ToOwned, S: ?Sized + ToOwned> Expected<T, &S>

source

pub fn into_owned(self) -> Expected<T::Owned, S::Owned>

Trait Implementations§

source§

impl<T: Clone, S: Clone> Clone for Expected<T, S>

source§

fn clone(&self) -> Self

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, S: Debug> Debug for Expected<T, S>

source§

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

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

impl<T: Show, S: Show> Display for Expected<T, S>

source§

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

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

impl<T, S> From<&'static str> for Expected<T, S>

source§

fn from(string: &'static str) -> Expected<T, S>

Converts to this type from the input type.
source§

impl<T, S> From<String> for Expected<T, S>

source§

fn from(string: String) -> Expected<T, S>

Converts to this type from the input type.