combine

Type Alias ConsumedResult

Source
pub type ConsumedResult<O, I> = FastResult<O, <I as StreamOnce>::Error>;
Expand description

A Result type which has the consumed status flattened into the result. Conversions to and from std::result::Result can be done using result.into() or From::from(result)

Aliased Type§

enum ConsumedResult<O, I> {
    ConsumedOk(O),
    EmptyOk(O),
    ConsumedErr(<I as StreamOnce>::Error),
    EmptyErr(Tracked<<I as StreamOnce>::Error>),
}

Variants§

§

ConsumedOk(O)

§

EmptyOk(O)

§

ConsumedErr(<I as StreamOnce>::Error)

§

EmptyErr(Tracked<<I as StreamOnce>::Error>)

Implementations

Source§

impl<T, E> FastResult<T, E>

Source

pub fn is_ok(&self) -> bool

Source

pub fn as_ref(&self) -> FastResult<&T, &E>

Source

pub fn and_then<F, T2>(self, f: F) -> F::Output
where F: FnOnce(T) -> FastResult<T2, E>,

Source

pub fn map_err<F, E2>(self, f: F) -> FastResult<T, F::Output>
where F: FnOnce(E) -> E2,

Source§

impl<T, E> FastResult<T, E>

Source

pub fn map<F, T2>(self, f: F) -> FastResult<F::Output, E>
where F: FnOnce(T) -> T2,

Trait Implementations

Source§

impl<T: Clone, E: Clone> Clone for FastResult<T, E>

Source§

fn clone(&self) -> FastResult<T, E>

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, E: Debug> Debug for FastResult<T, E>

Source§

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

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

impl<O, E> From<Result<(O, Consumed<()>), Consumed<Tracked<E>>>> for FastResult<O, E>

Source§

fn from(result: ParseResult2<O, E>) -> FastResult<O, E>

Converts to this type from the input type.
Source§

impl<O, E> Into<Result<(O, Consumed<()>), Consumed<Tracked<E>>>> for FastResult<O, E>

Source§

fn into(self) -> ParseResult2<O, E>

Converts this type into the (usually inferred) input type.
Source§

impl<T, E> Into<Result<Consumed<T>, Consumed<Tracked<E>>>> for FastResult<T, E>

Source§

fn into(self) -> Result<Consumed<T>, Consumed<Tracked<E>>>

Converts this type into the (usually inferred) input type.
Source§

impl<T: PartialEq, E: PartialEq> PartialEq for FastResult<T, E>

Source§

fn eq(&self, other: &FastResult<T, E>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<T: Copy, E: Copy> Copy for FastResult<T, E>

Source§

impl<T, E> StructuralPartialEq for FastResult<T, E>