#[repr(u32)]
pub enum FramingHeadersMode {
    Automatic,
    ManuallyFromHeaders,
}
Expand description

Determines how the framing headers (Content-Length/Transfer-Encoding) are set for a request or response.

Variants

Automatic

Determine the framing headers automatically based on the message body, and discard any framing headers already set in the message. This is the default behavior.

In automatic mode, a Content-Length is used when the size of the body can be determined before it is sent. Requests/responses sent in streaming mode, where headers are sent immediately but the content of the body is streamed later, will receive a Transfer-Encoding: chunked to accommodate the dynamic generation of the body.

ManuallyFromHeaders

Use the exact framing headers set in the message, falling back to Automatic if invalid.

In “from headers” mode, any Content-Length or Transfer-Encoding headers will be honored. You must ensure that those headers have correct values permitted by the HTTP/1.1 specification. If the provided headers are not permitted by the spec, the headers will revert to automatic mode and a log diagnostic will be issued about what was wrong. If a Content-Length is permitted by the spec, but the value doesn’t match the size of the actual body, the body will either be truncated (if it is too long), or the connection will be hung up early (if it is too short).

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Feeds this value into the given Hasher. Read more

Feeds a slice of this type into the given Hasher. Read more

This method returns an Ordering between self and other. Read more

Compares and returns the maximum of two values. Read more

Compares and returns the minimum of two values. Read more

Restrict a value to a certain interval. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

This method returns an ordering between self and other values if one exists. Read more

This method tests less than (for self and other) and is used by the < operator. Read more

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more

This method tests greater than (for self and other) and is used by the > operator. Read more

This method tests greater than or equal to (for self and other) and is used by the >= operator. 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

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

Uses borrowed data to replace owned data, usually by cloning. 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.