pub trait TypedApiEndpoint {
type State: Sync;
type Param: DeserializeOwned + Send;
type Response: Serialize;
const PATH: &'static str;
// Required method
fn handle<'state, 'context, 'dbtx, 'async_trait>(
state: &'state Self::State,
context: &'context mut ApiEndpointContext<'dbtx>,
request: Self::Param,
) -> Pin<Box<dyn Future<Output = Result<Self::Response, ApiError>> + Send + 'async_trait>>
where Self: 'async_trait,
'dbtx: 'context + 'async_trait,
'state: 'async_trait,
'context: 'async_trait;
}
Required Associated Constants§
Required Associated Types§
Required Methods§
fn handle<'state, 'context, 'dbtx, 'async_trait>(
state: &'state Self::State,
context: &'context mut ApiEndpointContext<'dbtx>,
request: Self::Param,
) -> Pin<Box<dyn Future<Output = Result<Self::Response, ApiError>> + Send + 'async_trait>>where
Self: 'async_trait,
'dbtx: 'context + 'async_trait,
'state: 'async_trait,
'context: 'async_trait,
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.