Endpoint

Trait Endpoint 

Source
pub trait Endpoint: Send + Sync {
    type Output: IntoResponse;

    // Required method
    fn call(&self, req: Request) -> Result<Self::Output, ChannelError>;

    // Provided method
    fn get_response(&self, req: Request) -> Response { ... }
}

Required Associated Types§

Source

type Output: IntoResponse

Represents the response of the endpoint.

Required Methods§

Source

fn call(&self, req: Request) -> Result<Self::Output, ChannelError>

Get the response to the request.

Provided Methods§

Implementors§

Source§

impl Endpoint for Route

Source§

impl<E, T> Endpoint for AddDataEndpoint<E, T>
where E: Endpoint, T: Clone + Send + Sync + 'static,