spin_sdk::http::conversions

Trait TryFromIncomingResponse

Source
pub trait TryFromIncomingResponse {
    type Error;

    // Required method
    fn try_from_incoming_response<'async_trait>(
        resp: IncomingResponse,
    ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
       where Self: Sized + 'async_trait;
}
Expand description

A trait for converting from an IncomingRequest

Required Associated Types§

Source

type Error

The error if conversion fails

Required Methods§

Source

fn try_from_incoming_response<'async_trait>( resp: IncomingResponse, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: Sized + 'async_trait,

Turn the IncomingResponse into the type

Implementations on Foreign Types§

Source§

impl<B: TryFromBody> TryFromIncomingResponse for Response<B>

Source§

type Error = <B as TryFromBody>::Error

Source§

fn try_from_incoming_response<'async_trait>( resp: IncomingResponse, ) -> Pin<Box<dyn Future<Output = Result<Self, Self::Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Implementors§