OkAndThen

Struct OkAndThen 

Source
pub struct OkAndThen<O, R, P, P1>(/* private fields */);
Expand description

AndThenExt::ok_and_then implementation

Trait Implementations§

Source§

impl<I, O, O2, E, R, R2, P, F> Pipe<I, O2, E, R2> for OkAndThen<O, R, P, F>
where P: Pipe<I, O, E, R>, F: FunMut<(R, O), Output = Result<(R2, O2), FatalError<E>>>,

Source§

fn apply(&mut self, input: I) -> Result<R2, O2, E>

Produces a Result from an input Read more

Auto Trait Implementations§

§

impl<O, R, P, P1> Freeze for OkAndThen<O, R, P, P1>
where P: Freeze, P1: Freeze,

§

impl<O, R, P, P1> RefUnwindSafe for OkAndThen<O, R, P, P1>

§

impl<O, R, P, P1> Send for OkAndThen<O, R, P, P1>
where P: Send, P1: Send, O: Send, R: Send,

§

impl<O, R, P, P1> Sync for OkAndThen<O, R, P, P1>
where P: Sync, P1: Sync, O: Sync, R: Sync,

§

impl<O, R, P, P1> Unpin for OkAndThen<O, R, P, P1>
where P: Unpin, P1: Unpin, O: Unpin, R: Unpin,

§

impl<O, R, P, P1> UnwindSafe for OkAndThen<O, R, P, P1>

Blanket Implementations§

Source§

impl<I, O, E, R, P> AndExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn and<O2, R2, P>(self, p: P) -> And<Self, P, O, O2, R>
where Self: Sized, O: Extend<O2>, O2: HList, P: Pipe<R, O2, E, R2>,

Chains 2 Pipes one after another Read more
Source§

fn and_other<O2, R2, P>(self, p: P) -> AndOther<Self, P, O, R>
where Self: Sized, P: Pipe<R, O2, E, R2>,

Chains 2 Pipes one after another Read more
Source§

fn and_self<O2, R2, P>(self, other: P) -> AndSelf<Self, P, R, O2>
where Self: Sized, P: Pipe<R, O2, E, R2>,

Chains 2 Pipes one after another Read more
Source§

impl<I, O, E, R, P> AndThenExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn and_then<O2, F>(self, f: F) -> AndThen<O, Self, F>
where Self: Sized, F: FunMut<O, Output = Result<O2, FatalError<E>>>, O: HList, O2: HList,

Applies the given closure on the output of the pipe Read more
Source§

fn and_thenf<O2, F>(self, f: F) -> AndThenF<O, Self, F>
where Self: Sized, F: FnMut(O) -> Result<O2, FatalError<E>>,

Applies the given closure on the output of a pipe Read more
Source§

fn ok_and_then<O2, R2, F>(self, other: F) -> OkAndThen<O, R, Self, F>
where Self: Sized, F: FunMut<(R, O), Output = Result<(R2, O2), FatalError<E>>>,

Applies the given closure to the output and remaining input of a pipe Read more
Source§

fn ok_then<O2, R2, P>(self, other: P) -> OkThen<O, R, Self, P>
where Self: Pipe<I, O, E, R> + Sized, P: Pipe<(R, O), O2, E, R2> + Sized,

Applies the pipes consecutively Read more
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<I, O, E, R, P> BoxedExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn boxed<'a>(self) -> BoxedPipe<'a, I, O, E, R>
where Self: Pipe<I, O, E, R> + Sized + 'a,

Wraps the current Pipe into a Box Read more
Source§

impl<I, O, E, R, P> EitherExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn either<O2, P>(self, p: P) -> EitherPipe<O, O2, Self, P>
where I: Clone, Self: Pipe<I, O, E, R> + Sized, P: Pipe<I, O2, E, R>,

Combine 2 Pipes with the same input and remaining but differents outputs Read more
Source§

fn either_full<O2, R2, P>(self, p: P) -> EitherPipeFull<O, O2, Self, P>
where I: Clone, Self: Pipe<I, O, E, R> + Sized, P: Pipe<I, O2, E, R2>,

Combine 2 Pipes with the same input and differents outputs and remaining Read more
Source§

impl<I, O, E, R, P> ErrExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn escalate(self) -> Escalate<Self>
where Self: Sized,

Makes non fatal errors fatal
Source§

fn deescalate(self) -> Deescalate<Self>
where Self: Sized,

makes fatal errors non fatal
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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<I, O, E, R, P> MapExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn map<F>(self, f: F) -> Map<Self, F, O>
where Self: Sized, O: HList, F: FunMut<O>,

Maps the output of a pipe O to O2 by applying a function to it. Read more
Source§

fn map1<F>(self, f: F) -> Map1<Self, F, O>
where Self: Sized, O: HList, F: FunMut<O>,

Maps the output of a pipe O to O2 by applying a function to it. The result is mapped into a tuple Read more
Source§

fn mapf<O2, F>(self, f: F) -> MapF<Self, F, O>
where Self: Sized, F: FnMut(O) -> O2,

Maps the output of a pipe O to O2 by applying a function to it. The result is mapped into a tuple Read more
Source§

fn map_err<E2, F>(self, f: F) -> MapErr<Self, F, E>
where Self: Sized, F: FnMut(FatalError<E>) -> FatalError<E2>,

Maps an error FatalError<E> to FatalError<E2> by applying a function to the error. Read more
Source§

impl<I, O, E, R, P> NotExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn not(self) -> Not<O, R, Self>
where I: Clone, O: Debug, Self: Sized,

Fails if the given pipe succeeds
Source§

impl<I, O, E, P> OptExt<I, O, E> for P
where P: Pipe<I, O, E>,

Source§

fn opt(self) -> Opt<Self, O>
where Self: Sized, I: Clone, O: Unpack,

Makes a Pipe optional if it returns a non fatal error Read more
Source§

impl<I, O, E, R, P> OrExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn or<P>(self, p: P) -> Or<Self, P>
where Self: Sized, I: Clone, P: Pipe<I, O, E, R>,

Apply the second Pipe if the first fails Read more
Source§

fn or_self<O2, P>(self, p: P) -> OrSelf<O, O2, Self, P>
where Self: Sized, O: Unpack, I: Clone, P: Pipe<I, O2, E, R>,

Apply the second Pipe if the first fails discarding the output of the second pipe Read more
Source§

fn or_other<O2, P>(self, p: P) -> OrOther<O, O2, Self, P>
where Self: Sized, I: Clone, O2: Unpack, P: Pipe<I, O2, E, R>,

Apply the second Pipe if the first fails discarding the output of the first pipe Read more
Source§

impl<I, O, E, R, P> PeekExt<I, O, E, R> for P
where I: Clone, P: Pipe<I, O, E, R>,

Source§

fn peek(self) -> Peek<Self, R>
where Self: Sized, I: Clone,

Makes a Pipe optional if it returns a non fatal error Read more
Source§

impl<I, O, E, P> RepeatExt<I, O, E> for P
where P: Pipe<I, O, E>,

Source§

fn repeat<R>(self, r: R) -> RepeatPipe<Self, O>
where R: TryInto<Repetition>, R::Error: Error, Self: Pipe<I, O, E> + Sized,

Repeats this pipe. Read more
Source§

impl<I, O, E, R, P> SkipExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn skip(self) -> Skip<Self, O>
where Self: Sized,

Discards the output of the pipe Read more
Source§

fn and_skip<O2, R2, P>(self, other: P) -> AndSkip<Self, P, O, O2, R>
where Self: Sized, P: Pipe<R, O2, E, R2>,

Chains 2 Pipes one after another both output are discarded Read more
Source§

fn or_skip<O2, P>(self, p: P) -> OrSkip<O, O2, Self, P>
where Self: Sized, I: Clone, P: Pipe<I, O2, E, R>,

Apply the second Pipe if the first fails discarding both output Read more
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.
Source§

impl<I, O, E, R, P> UnpackExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn unpack(self) -> UnpackPipe<Self, O>
where O: Unpack, Self: Sized,

Unpacks the output of a pipe Read more
Source§

impl<I, O, E, P> UntilExt<I, O, E> for P
where P: Pipe<I, O, E>,

Source§

fn until<O2, P>(self, p: P) -> Until<Self, P, O, O2>
where I: Clone, O: Unpack, O2: HList, (Vec<O::Output>,): Extend<O2>, Self: Sized, P: Pipe<I, O2, E>,

Applies a Pipe until the 2nd succeeds
Source§

fn no_more_until<O2, P>(self, p: P) -> NoMoreUntil<Self, P, O, O2>
where I: Clone, O: Unpack, O2: HList, (Vec<O::Output>,): Extend<O2>, Self: Sized, P: Pipe<I, O2, E>,

Applies self until p succeeds, self is applied 0 or more times
Source§

fn repeat_until<O2, R, P>(self, r: R, p: P) -> RepeatUntil<Self, P, O, O2>
where I: Clone, O: Unpack, O2: HList, R: TryInto<Repetition>, R::Error: Error, (Vec<O::Output>,): Extend<O2>, Self: Sized, P: Pipe<I, O2, E>,

repeats self with the given repetition then applies p
Source§

impl<I, O, E, R, P> WrapExt<I, O, E, R> for P
where P: Pipe<I, O, E, R>,

Source§

fn wrap<I2, O2, R2, F>(self, f: F) -> Wrap<I, O, R, Self, F>
where Self: Pipe<I, O, E, R> + Sized, F: FnMut(&mut Self, I2) -> Result<R2, O2, E>,

wraps self into a function Read more