pub enum PayloadSize {
Length(u64),
Chunked,
Empty,
}
Expand description
Represents the size information of an HTTP payload.
This enum is used to determine how the payload should be processed:
- Known length: Process exact number of bytes
- Chunked: Process using chunked transfer encoding
- Empty: No payload to process
Variants§
Length(u64)
Payload with known length in bytes
Chunked
Payload using chunked transfer encoding
Empty
Empty payload (no body)
Implementations§
Source§impl PayloadSize
impl PayloadSize
pub fn new_chunked() -> Self
pub fn new_empty() -> Self
pub fn new_length(length: u64) -> Self
Sourcepub fn is_chunked(&self) -> bool
pub fn is_chunked(&self) -> bool
Returns true if the payload uses chunked transfer encoding
Trait Implementations§
Source§impl Clone for PayloadSize
impl Clone for PayloadSize
Source§fn clone(&self) -> PayloadSize
fn clone(&self) -> PayloadSize
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for PayloadSize
impl Debug for PayloadSize
Source§impl From<PayloadSize> for SizeHint
impl From<PayloadSize> for SizeHint
Source§fn from(payload_size: PayloadSize) -> Self
fn from(payload_size: PayloadSize) -> Self
Converts to this type from the input type.
Source§impl From<SizeHint> for PayloadSize
impl From<SizeHint> for PayloadSize
Source§impl PartialEq for PayloadSize
impl PartialEq for PayloadSize
impl Copy for PayloadSize
impl Eq for PayloadSize
impl StructuralPartialEq for PayloadSize
Auto Trait Implementations§
impl Freeze for PayloadSize
impl RefUnwindSafe for PayloadSize
impl Send for PayloadSize
impl Sync for PayloadSize
impl Unpin for PayloadSize
impl UnwindSafe for PayloadSize
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