Skip to main content

Merge

Trait Merge 

Source
pub trait Merge<R> {
    type Merged;

    // Required methods
    fn into_continue(self) -> Self::Merged;
    fn from_done(resp: R) -> Self::Merged;
}
Expand description

Glue trait that lets a Branch::then(jig) accept a jig whose output is a request, a response, or another Branch, and merge the two outcomes into a single value.

Implement this for custom request/response types when you need to use them after a Branch. See the impl_request! and impl_response! convenience macros, or derive Request / Response which generate this automatically.

Required Associated Types§

Source

type Merged

Result of merging this value with the prior Branch.

Required Methods§

Source

fn into_continue(self) -> Self::Merged

Called when the previous Branch was Continue.

Source

fn from_done(resp: R) -> Self::Merged

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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<REQ, RESP> Merge<RESP> for Branch<REQ, RESP>
where REQ: Request, RESP: Response,

Source§

type Merged = Branch<REQ, RESP>