pub struct Response {
    pub status_code: StatusCode,
    /* private fields */
}
Expand description

An HTTP response

Fields

status_code: StatusCode

Implementations

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.

Read the entire body until the end of the stream.

Get the value of the name header. Returns HttpError::HeaderNotFound if no such header was found.

Get the entire response header map for a given request.

Trait Implementations

Automatically call close to remove the current handle when the response object goes out of scope.

Executes the destructor for this type. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more

Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more