Skip to main content

Branch

Enum Branch 

Source
pub enum Branch<Req, Resp> {
    Continue(Request<Req>),
    Done(Response<Resp>),
}
Expand description

Outcome of a guard jig: either continue with a (possibly transformed) request, or short-circuit the pipeline with a response.

Variants§

§

Continue(Request<Req>)

Continue the pipeline with this request.

§

Done(Response<Resp>)

Stop the pipeline and return this response.

Implementations§

Source§

impl<Req, Resp> Branch<Req, Resp>

Source

pub fn then<J>(self, jig: J) -> <J::Out as Merge<Resp>>::Merged
where J: Jig<Request<Req>>, J::Out: Merge<Resp>,

Append the next jig to a guarded pipeline. If the previous step was Done, its response is propagated and jig is not run.

Trait Implementations§

Source§

impl<NewReq, Resp> Merge<Resp> for Branch<NewReq, Resp>

Source§

type Merged = Branch<NewReq, Resp>

Result of merging this value with the prior Branch.
Source§

fn into_continue(self) -> Self::Merged

Called when the previous Branch was Continue.
Source§

fn from_done(resp: Response<Resp>) -> Self::Merged

Called when the previous Branch was Done, propagating its response.
Source§

impl<Req, Resp> Status for Branch<Req, Resp>

Source§

fn ok(&self) -> bool

Returns true if the value represents a successful outcome.
Source§

fn error(&self) -> Option<String>

Error message, if any. Defaults to None.
Source§

impl<R, P> Step for Branch<R, P>

Source§

type Out = Branch<R, P>

Resolved output of this step.
Source§

type Fut = Ready<Branch<R, P>>

Future yielding the output.
Source§

fn into_step(self) -> Self::Fut

Convert this value into the future the chain awaits.

Auto Trait Implementations§

§

impl<Req, Resp> Freeze for Branch<Req, Resp>
where Req: Freeze, Resp: Freeze,

§

impl<Req, Resp> RefUnwindSafe for Branch<Req, Resp>
where Req: RefUnwindSafe, Resp: RefUnwindSafe,

§

impl<Req, Resp> Send for Branch<Req, Resp>
where Req: Send, Resp: Send,

§

impl<Req, Resp> Sync for Branch<Req, Resp>
where Req: Sync, Resp: Sync,

§

impl<Req, Resp> Unpin for Branch<Req, Resp>
where Req: Unpin, Resp: Unpin,

§

impl<Req, Resp> UnsafeUnpin for Branch<Req, Resp>
where Req: UnsafeUnpin, Resp: UnsafeUnpin,

§

impl<Req, Resp> UnwindSafe for Branch<Req, Resp>
where Req: UnwindSafe, Resp: UnwindSafe,

Blanket Implementations§

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<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, 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.