Skip to main content

FromResponse

Trait FromResponse 

Source
pub trait FromResponse {
    // Required method
    fn from_response(response: Response) -> Result<Self, ErrorCode>
       where Self: Sized;
}
Expand description

A trait for constructing a value from a wasip3::http::types::Response.

This is the inverse of IntoResponse, allowing higher-level response types to be derived from standardized WASI HTTP responses—for example, to deserialize JSON payloads or map responses to domain-specific types.

§See also

Required Methods§

Source

fn from_response(response: Response) -> Result<Self, ErrorCode>
where Self: Sized,

Attempts to construct Self from a wasip3::http::types::Response.

Implementors§