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§
Sourcefn try_into_string(
self,
) -> impl Future<Output = Result<String, ServerFnError<CustErr>>> + Send
fn try_into_string( self, ) -> impl Future<Output = Result<String, ServerFnError<CustErr>>> + Send
Attempts to extract a UTF-8 string from an HTTP response.
Sourcefn try_into_bytes(
self,
) -> impl Future<Output = Result<Bytes, ServerFnError<CustErr>>> + Send
fn try_into_bytes( self, ) -> impl Future<Output = Result<Bytes, ServerFnError<CustErr>>> + Send
Attempts to extract a binary blob from an HTTP response.
Sourcefn try_into_stream(
self,
) -> Result<impl Stream<Item = Result<Bytes, ServerFnError>> + Send + Sync + 'static, ServerFnError<CustErr>>
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.
Sourcefn status_text(&self) -> String
fn status_text(&self) -> String
Status text for the status code.
Sourcefn has_redirect(&self) -> bool
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.