pub(crate) struct Encoder {
kind: Kind,
is_last: bool,
}
Expand description
Encoders to handle different Transfer-Encodings.
Fields§
§kind: Kind
§is_last: bool
Implementations§
source§impl Encoder
impl Encoder
fn new(kind: Kind) -> Encoder
pub(crate) fn chunked() -> Encoder
pub(crate) fn length(len: u64) -> Encoder
pub(crate) fn close_delimited() -> Encoder
pub(crate) fn is_eof(&self) -> bool
pub(crate) fn set_last(self, is_last: bool) -> Self
pub(crate) fn is_last(&self) -> bool
pub(crate) fn is_close_delimited(&self) -> bool
pub(crate) fn end<B>(&self) -> Result<Option<EncodedBuf<B>>, NotEof>
pub(crate) fn encode<B>(&mut self, msg: B) -> EncodedBuf<B>where
B: Buf,
pub(super) fn encode_and_end<B>(
&self,
msg: B,
dst: &mut WriteBuf<EncodedBuf<B>>,
) -> boolwhere
B: Buf,
sourcepub(super) fn danger_full_buf<B>(
self,
msg: B,
dst: &mut WriteBuf<EncodedBuf<B>>,
)where
B: Buf,
pub(super) fn danger_full_buf<B>(
self,
msg: B,
dst: &mut WriteBuf<EncodedBuf<B>>,
)where
B: Buf,
Encodes the full body, without verifying the remaining length matches.
This is used in conjunction with HttpBody::__hyper_full_data(), which means we can trust that the buf has the correct size (the buf itself was checked to make the headers).
Trait Implementations§
impl StructuralPartialEq for Encoder
Auto Trait Implementations§
impl Freeze for Encoder
impl RefUnwindSafe for Encoder
impl Send for Encoder
impl Sync for Encoder
impl Unpin for Encoder
impl UnwindSafe for Encoder
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)