leptos::server_fn::response

Trait ClientRes

Source
pub trait ClientRes<CustErr> {
    // Required methods
    fn try_into_string(
        self,
    ) -> impl Future<Output = Result<String, ServerFnError<CustErr>>> + Send;
    fn try_into_bytes(
        self,
    ) -> impl Future<Output = Result<Bytes, ServerFnError<CustErr>>> + Send;
    fn try_into_stream(
        self,
    ) -> Result<impl Stream<Item = Result<Bytes, ServerFnError>> + Send + Sync + 'static, ServerFnError<CustErr>>;
    fn status(&self) -> u16;
    fn status_text(&self) -> String;
    fn location(&self) -> String;
    fn has_redirect(&self) -> bool;
}
Expand description

Represents the response as received by the client.

Required Methods§

Source

fn try_into_string( self, ) -> impl Future<Output = Result<String, ServerFnError<CustErr>>> + Send

Attempts to extract a UTF-8 string from an HTTP response.

Source

fn try_into_bytes( self, ) -> impl Future<Output = Result<Bytes, ServerFnError<CustErr>>> + Send

Attempts to extract a binary blob from an HTTP response.

Source

fn try_into_stream( self, ) -> Result<impl Stream<Item = Result<Bytes, ServerFnError>> + Send + Sync + 'static, ServerFnError<CustErr>>

Attempts to extract a binary stream from an HTTP response.

Source

fn status(&self) -> u16

HTTP status code of the response.

Source

fn status_text(&self) -> String

Status text for the status code.

Source

fn location(&self) -> String

The Location header or (if none is set), the URL of the response.

Source

fn has_redirect(&self) -> bool

Whether the response has the REDIRECT_HEADER set.

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§

Source§

impl<CustErr> ClientRes<CustErr> for BrowserResponse