pub trait JsonPayloadDecoder<T>:
Send
+ Sync
+ 'static {
type Error: Error + Send + Sync + 'static;
// Required method
fn decode_json_payload(&self, raw_json: &str) -> Result<T, Self::Error>;
}Expand description
Converts one borrowed raw JSON value into one concrete state payload.
T stays explicit at this boundary. Any thread-safe
Fn(&str) -> Result<T, E> implements the trait automatically; named decoder
types may implement it directly when they own configuration or shared state.
Required Associated Types§
Required Methods§
Sourcefn decode_json_payload(&self, raw_json: &str) -> Result<T, Self::Error>
fn decode_json_payload(&self, raw_json: &str) -> Result<T, Self::Error>
Decodes exactly one complete raw JSON value into an owned payload.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".