pub trait Operation: Sized + 'static {
type Request: WasmCompatSend + 'static;
type Event: WasmCompatSend + 'static;
type End: WasmCompatSend + 'static;
type Response: WasmCompatSend + 'static;
type Fold: Fold<Self> + WasmCompatSend + 'static;
type Emit: Emit<Self>;
// Required method
fn fold(request: &Self::Request, call: &mut Call<'_>) -> Self::Fold;
// Provided method
fn validate(_request: &Self::Request) -> Result<(), ProviderError> { ... }
}Expand description
An operation: what goes in, what comes out event by event, what ends a reply, and how those fold into one response.
Implemented once per operation, never per provider, so every provider of
an operation is interchangeable behind a DynModel.
Required Associated Types§
Sourcetype Request: WasmCompatSend + 'static
type Request: WasmCompatSend + 'static
The normalized request this operation accepts.
Sourcetype Event: WasmCompatSend + 'static
type Event: WasmCompatSend + 'static
One decoded step of a reply.
Sourcetype End: WasmCompatSend + 'static
type End: WasmCompatSend + 'static
What the provider sends when it ends the reply. A fold needs one to produce a response, so a reply that stopped early has none.
Sourcetype Response: WasmCompatSend + 'static
type Response: WasmCompatSend + 'static
The normalized response the events and the end fold into.
Sourcetype Fold: Fold<Self> + WasmCompatSend + 'static
type Fold: Fold<Self> + WasmCompatSend + 'static
One reply’s state: it absorbs the events the consumer sees, then folds them with the end into the response.
Required Methods§
Provided Methods§
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".