Trait FromResponse

Source
pub trait FromResponse: Sized {
    // Required method
    fn from_response(json: &Value) -> Result<Self, ParseError>;

    // Provided method
    fn from_response_inherit(
        json: &Value,
        prev: &Self,
    ) -> Result<Self, ParseError> { ... }
}
Expand description

Response parsing.

Required Methods§

Source

fn from_response(json: &Value) -> Result<Self, ParseError>

Parse a JSON response.

Provided Methods§

Source

fn from_response_inherit(json: &Value, prev: &Self) -> Result<Self, ParseError>

Parse a JSON response, inheriting missing values from the previous instance.

Necessary for parsing refresh token responses where the absence of a new refresh token implies that the previous refresh token is still valid.

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§