pub trait Endpoint: Send + Sync + 'static {
fn apply<'life0, 'async_trait>(
self: Pin<&'life0 Self>,
request: Request
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>
where
Self: 'async_trait,
'life0: 'async_trait;
}Expand description
Required Methods§
sourcefn apply<'life0, 'async_trait>(
self: Pin<&'life0 Self>,
request: Request
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn apply<'life0, 'async_trait>(
self: Pin<&'life0 Self>,
request: Request
) -> Pin<Box<dyn Future<Output = Result<Response, Error>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Transforms the request into the response. However, a request may fail, and such a failure can be handled by down the stack.
Trait Implementations§
Implementors§
impl Endpoint for ScopeEndpoint
impl Endpoint for Router
impl<F, Fut> Endpoint for SseEndpoint<F>where
F: Fn(Request, Sender) -> Fut + Send + Sync + 'static,
Fut: Future<Output = Result<()>> + Send + 'static,
Available on crate feature
sse only.