pub trait AnyBlockingResponse:
Read
+ Any
+ Send
+ Sync
+ 'static {
// Required methods
fn describe(&self, f: &mut Formatter<'_>) -> Result;
fn status(&self) -> u16;
fn content_length(&self) -> Option<u64>;
fn get_header(&self, header: &str) -> Result<Vec<String>>;
fn text(&mut self) -> Result<String>;
fn bytes(&mut self) -> Result<Vec<u8>>;
}
Available on crate feature
blocking
only.Expand description
Trait for type-erased blocking HTTP responses.
Automatically implemented for types implementing BlockingResponse
.
It extends io::Read to allow streaming the response body.
Required Methods§
Sourcefn describe(&self, f: &mut Formatter<'_>) -> Result
fn describe(&self, f: &mut Formatter<'_>) -> Result
Provides a textual description of this response.
Sourcefn content_length(&self) -> Option<u64>
fn content_length(&self) -> Option<u64>
Returns the content-length of the response body, if known.