pub struct Response { /* private fields */ }
Expand description

The handshake response.

Implementations

Construct a generic HTTP response with a body.

Get the response body.

Edit the value of the first instance of an HTTP header.

Access the request headers.

Edit the request headers.

Get the HTTP status code.

Set the HTTP status code.

Get the HTTP status reason.

Set the HTTP status reason.

Get the hashed WebSocket key.

Get the protocol that the server has decided to use.

Set the protocol that the server has decided to use.

Get the extensions that the server has decided to use. If these are unacceptable, it is appropriate to send an Extension close code.

Add an accepted extension to this response. This may result in duplicate extensions listed.

Remove an accepted extension from this response. This will remove all configurations of the extension.

Attempt to parse an HTTP response from a buffer. If the buffer does not contain a complete response, thiw will return Ok(None).

Construct a new WebSocket handshake HTTP response from a request. This will create a response that ignores protocols and extensions. Edit this response to accept a protocol and extensions as necessary.

Write a response out to a buffer

Trait Implementations

Formats the value using the given formatter. Read more

Formats the value using the given formatter. 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.

Calls U::from(self).

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

Should always be Self

Converts the given value to a String. Read more

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.