Skip to main content

IntoResponse

Trait IntoResponse 

Source
pub trait IntoResponse {
    // Required method
    fn into_response(self) -> Result<Response, ErrorCode>;
}
Expand description

A trait for any type that can be converted into a wasip3::http::types::Response.

This trait provides a unified interface for adapting user-defined response types into the lower-level wasip3::http::types::Response format used by the WASI HTTP subsystem.

Implementing IntoResponse enables ergonomic conversion from domain-level response types or builders into standardized WASI HTTP responses.

§See also

Required Methods§

Implementations on Foreign Types§

Source§

impl IntoResponse for &'static str

Source§

impl IntoResponse for String

Source§

impl IntoResponse for Response

Source§

impl<T> IntoResponse for (StatusCode, T)
where T: Body + Any, T::Data: Into<Vec<u8>>, T::Error: Into<Box<dyn Error + Send + Sync + 'static>>,

Source§

impl<T> IntoResponse for Response<T>
where T: Body + Any, T::Data: Into<Vec<u8>>, T::Error: Into<Box<dyn Error + Send + Sync + 'static>>,

Implementors§

Source§

impl<Ok: IntoResponse, Err: Into<Error>> IntoResponse for Result<Ok, Err>