Enum fastly_shared::FramingHeadersMode
source · [−]#[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
sourceimpl Clone for FramingHeadersMode
impl Clone for FramingHeadersMode
sourcefn clone(&self) -> FramingHeadersMode
fn clone(&self) -> FramingHeadersMode
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FramingHeadersMode
impl Debug for FramingHeadersMode
sourceimpl Default for FramingHeadersMode
impl Default for FramingHeadersMode
sourceimpl Hash for FramingHeadersMode
impl Hash for FramingHeadersMode
sourceimpl Ord for FramingHeadersMode
impl Ord for FramingHeadersMode
sourceimpl PartialOrd<FramingHeadersMode> for FramingHeadersMode
impl PartialOrd<FramingHeadersMode> for FramingHeadersMode
sourcefn partial_cmp(&self, other: &FramingHeadersMode) -> Option<Ordering>
fn partial_cmp(&self, other: &FramingHeadersMode) -> Option<Ordering>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl Copy for FramingHeadersMode
impl Eq for FramingHeadersMode
impl StructuralEq for FramingHeadersMode
impl StructuralPartialEq for FramingHeadersMode
Auto Trait Implementations
impl RefUnwindSafe for FramingHeadersMode
impl Send for FramingHeadersMode
impl Sync for FramingHeadersMode
impl Unpin for FramingHeadersMode
impl UnwindSafe for FramingHeadersMode
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more