pub struct Fallback<P, S> {
pub primary: P,
pub secondary: S,
}Expand description
A Pipe combinator that routes to secondary when primary fails.
primary.call(input.clone()) is tried first; on any error,
secondary.call(input) is called with the original input. On success,
secondary is never invoked.
Requires P::In: Clone so the input can be replayed.
Fields§
§primary: P§secondary: STrait Implementations§
Auto Trait Implementations§
impl<P, S> Freeze for Fallback<P, S>
impl<P, S> RefUnwindSafe for Fallback<P, S>where
P: RefUnwindSafe,
S: RefUnwindSafe,
impl<P, S> Send for Fallback<P, S>
impl<P, S> Sync for Fallback<P, S>
impl<P, S> Unpin for Fallback<P, S>
impl<P, S> UnsafeUnpin for Fallback<P, S>where
P: UnsafeUnpin,
S: UnsafeUnpin,
impl<P, S> UnwindSafe for Fallback<P, S>where
P: UnwindSafe,
S: UnwindSafe,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<P> PipeExt for Pwhere
P: Pipe,
impl<P> PipeExt for Pwhere
P: Pipe,
Source§fn and_then<Next>(self, next: Next) -> AndThen<Self, Next>
fn and_then<Next>(self, next: Next) -> AndThen<Self, Next>
self.and_then(next) is AndThen::new(self, next) — reads
left-to-right at the call site.Source§fn fanout(self, other: Self) -> FanOut<Self, AllOrNothing>
fn fanout(self, other: Self) -> FanOut<Self, AllOrNothing>
Broadcast to
self and other, all-or-nothing.