Struct wasi_experimental_http::Response [−][src]
pub struct Response {
pub status_code: StatusCode,
// some fields omitted
}An HTTP response
Fields
status_code: StatusCodeImplementations
impl Response[src]
impl Response[src]pub fn body_read(&mut self, buf: &mut [u8]) -> Result<usize, Error>[src]
Read a response body in a streaming fashion.
buf is an arbitrary large buffer, that may be partially filled after each call.
The function returns the actual number of bytes that were written, and 0
when the end of the stream has been reached.
pub fn body_read_all(&mut self) -> Result<Vec<u8>, Error>[src]
Read the entire body until the end of the stream.
pub fn header_get(&self, name: String) -> Result<String, Error>[src]
Get the value of the name header.
Returns HttpError::HeaderNotFound if no such header was found.
pub fn headers_get_all(&self) -> Result<HeaderMap, Error>[src]
Get the entire response header map for a given request.
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for Response
impl RefUnwindSafe for Responseimpl UnwindSafe for Response
impl UnwindSafe for ResponseBlanket Implementations
impl<T> Instrument for T[src]
impl<T> Instrument for T[src]