Trait ClientRes
pub trait ClientRes<E> {
// Required methods
fn try_into_string(self) -> impl Future<Output = Result<String, E>> + Send;
fn try_into_bytes(self) -> impl Future<Output = Result<Bytes, E>> + Send;
fn try_into_stream(
self,
) -> Result<impl Stream<Item = Result<Bytes, Bytes>> + Send + Sync + 'static, E>;
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§
fn try_into_string(self) -> impl Future<Output = Result<String, E>> + Send
fn try_into_string(self) -> impl Future<Output = Result<String, E>> + Send
Attempts to extract a UTF-8 string from an HTTP response.
fn try_into_bytes(self) -> impl Future<Output = Result<Bytes, E>> + Send
fn try_into_bytes(self) -> impl Future<Output = Result<Bytes, E>> + Send
Attempts to extract a binary blob from an HTTP response.
fn try_into_stream(
self,
) -> Result<impl Stream<Item = Result<Bytes, Bytes>> + Send + Sync + 'static, E>
fn try_into_stream( self, ) -> Result<impl Stream<Item = Result<Bytes, Bytes>> + Send + Sync + 'static, E>
Attempts to extract a binary stream from an HTTP response.
fn status_text(&self) -> String
fn status_text(&self) -> String
Status text for the status code.
fn 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.