Trait TypedResponse

Source
pub trait TypedResponse: Sized {
    // Required method
    fn from_bpsv(doc: &BpsvDocument<'_>) -> Result<Self>;

    // Provided method
    fn from_response(response: &Response) -> Result<Self> { ... }
}
Expand description

Trait for typed responses that can be parsed from BPSV documents

Required Methods§

Source

fn from_bpsv(doc: &BpsvDocument<'_>) -> Result<Self>

Parse the response from a BPSV document

§Errors

Returns an error if parsing the BPSV document fails.

Provided Methods§

Source

fn from_response(response: &Response) -> Result<Self>

Parse from a raw response

§Errors

Returns an error if the response has no data or parsing fails.

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§