pub struct Response {
pub status: u16,
pub headers: HashMap<String, String>,
pub raw_headers: Vec<Header>,
/* private fields */
}Expand description
A response. The body is a stream of byte-chunk results; a chunk is Err if the
stream was reset or the connection failed mid-download, so a truncated body is
never mistaken for a complete one (mirrors the TS body stream erroring).
Fields§
§status: u16§headers: HashMap<String, String>§raw_headers: Vec<Header>Implementations§
Source§impl Response
impl Response
Sourcepub fn into_body(self) -> ResponseBody
pub fn into_body(self) -> ResponseBody
The response body as a backpressured stream of chunk results (Err on
reset/failure). The receive window is replenished as chunks are pulled.
Sourcepub async fn bytes(&mut self) -> Result<Vec<u8>, H2Error>
pub async fn bytes(&mut self) -> Result<Vec<u8>, H2Error>
Buffer the whole body. Errors if the stream was reset or failed mid-download.
Auto Trait Implementations§
impl !RefUnwindSafe for Response
impl !Send for Response
impl !Sync for Response
impl !UnwindSafe for Response
impl Freeze for Response
impl Unpin for Response
impl UnsafeUnpin for Response
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more