Skip to main content

Request

Trait Request 

Source
pub trait Request: Sized + __Classify {
    type Payload;

    // Required methods
    fn payload(&self) -> &Self::Payload;
    fn into_payload(self) -> Self::Payload;
    fn from_payload(payload: Self::Payload) -> Self;

    // Provided method
    fn then<J, U>(self, jig: J) -> U
       where J: Jig<Self, Out = U> { ... }
}
Expand description

An inbound message flowing through a pipeline.

Types implementing this trait can be chained with .then(jig) on the request side.

Required Associated Types§

Source

type Payload

Payload extracted from this request.

Required Methods§

Source

fn payload(&self) -> &Self::Payload

Borrow the payload.

Source

fn into_payload(self) -> Self::Payload

Consume the request and return the payload.

Source

fn from_payload(payload: Self::Payload) -> Self

Wrap a payload into a request.

Provided Methods§

Source

fn then<J, U>(self, jig: J) -> U
where J: Jig<Self, Out = U>,

Append the next jig to the pipeline.

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§