pub trait CustomApi: 'static + Debug + Send + Sync {
type Request: Serialize + for<'de> Deserialize<'de> + Send + Sync + Debug;
type Response: Clone + Serialize + for<'de> Deserialize<'de> + Send + Sync + Debug;
type Error: CustomApiError;
}
Expand description
A definition of a custom API. The Request
associated type is what a
connected client can send. The Response
associated type is what your API
is expecetd to send from the server to the client. The Dispatcher
is the
type that will handle the custom API requests.
This feature is powered by [actionable
] through these derives:
Action
(trait and derive macro)Actionable
(derive macro)
Associated Types
The type that represents an API request. This type is what clients will send to the server.
The type that represents an API response. This type will be sent to clients from the server.
type Error: CustomApiError
type Error: CustomApiError
The error type that this Api instance can return.