pub struct TransferEncoding { /* private fields */ }
Expand description
The form of encoding used to safely transfer the payload body to the user.
§Specifications
§Examples
use http_types::Response;
use http_types::transfer::{TransferEncoding, Encoding};
let mut encoding = TransferEncoding::new(Encoding::Chunked);
let mut res = Response::new(200);
encoding.apply(&mut res);
let encoding = TransferEncoding::from_headers(res)?.unwrap();
assert_eq!(encoding, &Encoding::Chunked);
Implementations§
Source§impl TransferEncoding
impl TransferEncoding
Sourcepub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>
pub fn from_headers(headers: impl AsRef<Headers>) -> Result<Option<Self>>
Create a new instance from headers.
Sourcepub fn name(&self) -> HeaderName
pub fn name(&self) -> HeaderName
Get the HeaderName
.
Sourcepub fn value(&self) -> HeaderValue
pub fn value(&self) -> HeaderValue
Get the HeaderValue
.
Trait Implementations§
Source§impl Debug for TransferEncoding
impl Debug for TransferEncoding
Source§impl Deref for TransferEncoding
impl Deref for TransferEncoding
Source§impl DerefMut for TransferEncoding
impl DerefMut for TransferEncoding
Source§impl From<&Encoding> for TransferEncoding
impl From<&Encoding> for TransferEncoding
Source§impl From<&EncodingProposal> for TransferEncoding
impl From<&EncodingProposal> for TransferEncoding
Source§fn from(encoding: &EncodingProposal) -> Self
fn from(encoding: &EncodingProposal) -> Self
Converts to this type from the input type.
Source§impl From<Encoding> for TransferEncoding
impl From<Encoding> for TransferEncoding
Source§impl From<EncodingProposal> for TransferEncoding
impl From<EncodingProposal> for TransferEncoding
Source§fn from(encoding: EncodingProposal) -> Self
fn from(encoding: EncodingProposal) -> Self
Converts to this type from the input type.
Source§impl PartialEq<&Encoding> for TransferEncoding
impl PartialEq<&Encoding> for TransferEncoding
Source§impl PartialEq<Encoding> for TransferEncoding
impl PartialEq<Encoding> for TransferEncoding
Source§impl ToHeaderValues for TransferEncoding
impl ToHeaderValues for TransferEncoding
Source§type Iter = IntoIter<HeaderValue>
type Iter = IntoIter<HeaderValue>
Returned iterator over header values which this type may correspond to.
Source§fn to_header_values(&self) -> Result<Self::Iter>
fn to_header_values(&self) -> Result<Self::Iter>
Converts this object to an iterator of resolved
HeaderValues
.Auto Trait Implementations§
impl Freeze for TransferEncoding
impl RefUnwindSafe for TransferEncoding
impl Send for TransferEncoding
impl Sync for TransferEncoding
impl Unpin for TransferEncoding
impl UnwindSafe for TransferEncoding
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more