RequestDecodeResult

Trait RequestDecodeResult 

Source
pub trait RequestDecodeResult<T, R> {
    type VerifyDecode;

    // Required methods
    fn decode_client_response(
        &self,
        res: Result<R, RequestError>,
    ) -> impl Future<Output = Result<Result<T, ServerFnError>, RequestError>> + Send;
    fn verify_can_deserialize(&self) -> Self::VerifyDecode;
}
Expand description

Convert the reqwest response into the desired type, in place. The point here is to prefer FromResponse types first and then DeserializeOwned types second.

This is because FromResponse types are more specialized and can handle things like websockets and files. DeserializeOwned types are more general and can handle things like JSON responses.

Required Associated Types§

Required Methods§

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.

Implementors§