Skip to main content

FromRequest

Trait FromRequest 

Source
pub trait FromRequest {
    // Required method
    fn from_request(req: Request) -> Result<Self, ErrorCode>
       where Self: Sized;
}
Available on crate feature http only.
Expand description

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

This is the inverse of IntoRequest, allowing higher-level request types to be built from standardized WASI HTTP requests—for example, to parse structured payloads, extract query parameters, or perform request validation.

§See also

Required Methods§

Source

fn from_request(req: Request) -> Result<Self, ErrorCode>
where Self: Sized,

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

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl FromRequest for Request

Implementors§

Source§

impl FromRequest for spin_sdk::http::Request