pub trait AnyAsyncResponse:
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) -> BoxFuture<'_, Result<String>>;
fn bytes(&mut self) -> BoxFuture<'_, Result<Vec<u8>>>;
}
Available on crate feature
async
only.Expand description
Trait for type-erased async HTTP responses.
Automatically implemented for types implementing AsyncResponse
.
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.