Enum actix_web::body::BodySize [−][src]
pub enum BodySize {
None,
Sized(u64),
Stream,
}
Expand description
Body size hint.
Variants
None
Absence of body can be assumed from method or status code.
Will skip writing Content-Length header.
Sized(u64)
Tuple Fields
0: u64
Known size body.
Will write Content-Length: N
header.
Stream
Unknown size body.
Will not write Content-Length header. Can be used with chunked Transfer-Encoding.
Implementations
Returns true if size hint indicates no or empty body.
Streams will return false because it cannot be known without reading the stream.
assert!(BodySize::None.is_eof());
assert!(BodySize::Sized(0).is_eof());
assert!(!BodySize::Sized(64).is_eof());
assert!(!BodySize::Stream.is_eof());
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for BodySize
impl UnwindSafe for BodySize
Blanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more