pub trait Family:
Sealed
+ Clone
+ Copy
+ Send
+ Sync
+ 'static {
type Request: WasmCompatSend + 'static;
type Answer: WasmCompatSend + 'static;
const FAMILY: EffectFamily;
// Required methods
fn wrap(request: Self::Request) -> Result<EffectKind, ErrorReport>;
fn unwrap(outcome: Outcome) -> Result<Self::Answer, ErrorReport>;
// Provided method
fn mismatch(outcome: &Outcome) -> ErrorReport { ... }
}Expand description
Sealed mapping between typed requests and answers and the wire’s
EffectKind and Outcome. Hosts extend the protocol through
CustomEffect and family::Custom, not new family implementations.
Required Associated Constants§
Sourceconst FAMILY: EffectFamily
const FAMILY: EffectFamily
The family this marker names.
Required Associated Types§
Sourcetype Request: WasmCompatSend + 'static
type Request: WasmCompatSend + 'static
What a typed dispatch of this family takes.
Sourcetype Answer: WasmCompatSend + 'static
type Answer: WasmCompatSend + 'static
What it resolves to.
Required Methods§
Sourcefn wrap(request: Self::Request) -> Result<EffectKind, ErrorReport>
fn wrap(request: Self::Request) -> Result<EffectKind, ErrorReport>
The wire form of a request, or the report for a request that has
none (a CustomEffect whose Serialize fails). The in-tree
families always have one; a typed dispatch of a request without one
is pre-failed by the bus and never reaches a handler or a log.
Provided Methods§
Sourcefn mismatch(outcome: &Outcome) -> ErrorReport
fn mismatch(outcome: &Outcome) -> ErrorReport
The report Family::unwrap gives for an outcome of another family.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".