pub trait DecodeRequest: Sized + Sealed {
type Action: ActionName;
// Required method
fn decode_reporting(
action: Self::Action,
payload: &RawValue,
options: &DecodeOptions,
) -> Result<Decoded<Self>, DecodeError>;
}Expand description
A union of the requests one side receives — v2_1::CsRequest on a CSMS,
v2_1::CsmsRequest on a station — decodable from an action and a raw payload.
Implemented by the code generator. A handler normally uses it through
Ctx::decode, which also reports what leniency forgave.
Required Associated Types§
Sourcetype Action: ActionName
type Action: ActionName
This version’s action enum.
Required Methods§
Sourcefn decode_reporting(
action: Self::Action,
payload: &RawValue,
options: &DecodeOptions,
) -> Result<Decoded<Self>, DecodeError>
fn decode_reporting( action: Self::Action, payload: &RawValue, options: &DecodeOptions, ) -> Result<Decoded<Self>, DecodeError>
Decodes payload for action, returning the value and every
Repair the options applied.
§Errors
The classified DecodeError — including
UnsupportedAction when action is not one this side receives.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".