pub trait Response {
type Payload;
// Required method
fn into_payload<D>(decoded: Decoded<Self, D>) -> Decoded<Self::Payload, D>;
}Expand description
A protocol response message.
Two-way FIDL responses can be strict or flexible, and flexible responses wrap their responses in a FIDL union. This means that strict and flexible FIDL responses have different wire formats even though we treat flexible errors as protocol errors. So the protocol and bind layers get a little mixed up here.
To solve this, FIDL response types implement this Response trait and
define how to “unwrap” themselves into their decoded Payload types. This
eliminates an unnecessary .0 field access that we’d have to do otherwise.
Required Associated Types§
Required Methods§
Sourcefn into_payload<D>(decoded: Decoded<Self, D>) -> Decoded<Self::Payload, D>
fn into_payload<D>(decoded: Decoded<Self, D>) -> Decoded<Self::Payload, D>
Converts a Decoded of this type to a Decoded of its payload type.
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.