Struct headers_ext::TransferEncoding
source · pub struct TransferEncoding(_);
Expand description
Transfer-Encoding
header, defined in
RFC7230
The Transfer-Encoding
header field lists the transfer coding names
corresponding to the sequence of transfer codings that have been (or
will be) applied to the payload body in order to form the message
body.
Note that setting this header will remove any previously set
Content-Length
header, in accordance with
RFC7230:
A sender MUST NOT send a Content-Length header field in any message that contains a Transfer-Encoding header field.
ABNF
Transfer-Encoding = 1#transfer-coding
Example values
chunked
gzip, chunked
Example
use headers::TransferEncoding;
let transfer = TransferEncoding::chunked();
Implementations
sourceimpl TransferEncoding
impl TransferEncoding
sourcepub fn chunked() -> TransferEncoding
pub fn chunked() -> TransferEncoding
Constructor for the most common Transfer-Encoding, chunked
.
sourcepub fn is_chunked(&self) -> bool
pub fn is_chunked(&self) -> bool
Returns whether this ends with the chunked
encoding.
Trait Implementations
sourceimpl Clone for TransferEncoding
impl Clone for TransferEncoding
sourcefn clone(&self) -> TransferEncoding
fn clone(&self) -> TransferEncoding
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 moresourceimpl Debug for TransferEncoding
impl Debug for TransferEncoding
sourceimpl Header for TransferEncoding
impl Header for TransferEncoding
sourceconst NAME: &'static HeaderName = _
const NAME: &'static HeaderName = _
The name of this header.
Auto Trait Implementations
impl RefUnwindSafe for TransferEncoding
impl Send for TransferEncoding
impl Sync for TransferEncoding
impl Unpin for TransferEncoding
impl UnwindSafe for TransferEncoding
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
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