Skip to main content

SendTarget

Trait SendTarget 

Source
pub trait SendTarget {
    // Required method
    fn call(self, req: Request) -> impl Future<Output = Response> + Send;
}
Available on crate feature test only.
Expand description

Trait for sending request to target, such as Router, Service, Handler for test usage.

Required Methods§

Source

fn call(self, req: Request) -> impl Future<Output = Response> + Send

Send request to target, such as Router, Service, Handler.

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.

Implementations on Foreign Types§

Source§

impl SendTarget for Arc<Router>

Source§

async fn call(self, req: Request) -> Response

Source§

impl<T> SendTarget for Arc<T>
where T: Handler + Send,

Source§

async fn call(self, req: Request) -> Response

Implementors§