pub trait Service: Send + Sync {
type Data: Send + Sync;
// Required method
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 Request,
ctx: &'life2 Self::Data,
) -> Pin<Box<dyn Future<Output = Result<Option<Response>>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait;
}
Expand description
Trait for async services that maybe handle a request.
Only available with the async
feature.
Required Associated Types§
Required Methods§
Sourcefn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 Request,
ctx: &'life2 Self::Data,
) -> Pin<Box<dyn Future<Output = Result<Option<Response>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn handle<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
request: &'life1 Request,
ctx: &'life2 Self::Data,
) -> Pin<Box<dyn Future<Output = Result<Option<Response>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
See Service for more information.