Skip to main content

View

Trait View 

Source
pub trait View:
    Clone
    + Send
    + Sync
    + 'static {
    // Required method
    fn call(self, req: Request) -> Result<Response, Error>;
}
Expand description

A request handler producing a response or an error.

Required Methods§

Source

fn call(self, req: Request) -> Result<Response, Error>

Run this view against the request.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<F> View for F
where F: Fn(Request) -> Result<Response, Error> + Clone + Send + Sync + 'static,