pub trait HasApiContext<State> {
// Required method
fn context<'life0, 'life1, 'async_trait>(
&'life0 self,
request: &'life1 ApiRequestErased,
id: Option<ModuleInstanceId>,
) -> Pin<Box<dyn Future<Output = (&State, ApiEndpointContext<'_>)> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait;
}
Expand description
Has the context necessary for serving API endpoints
Returns the specific State
the endpoint requires and the
ApiEndpointContext
which all endpoints can access.