#[non_exhaustive]pub enum BodyFraming {
None,
Length(u64),
Chunked,
UntilClose,
}Expand description
How a message’s body is delimited.
§Examples
use http_net::{BodyFraming, ServerConn, ServerEvent};
let mut conn = ServerConn::new();
let _ = conn.feed(b"POST /x HTTP/1.1\r\nHost: a\r\nContent-Length: 3\r\n\r\nabc");
match conn.poll().unwrap() {
ServerEvent::Request(req) => assert_eq!(req.framing(), BodyFraming::Length(3)),
other => panic!("{other:?}"),
}Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
None
No body.
Length(u64)
Exactly this many bytes (Content-Length).
Chunked
Transfer-Encoding: chunked.
UntilClose
The body runs until the peer closes the connection (responses only).
Trait Implementations§
Source§impl Clone for BodyFraming
impl Clone for BodyFraming
impl Copy for BodyFraming
Source§impl Debug for BodyFraming
impl Debug for BodyFraming
impl Eq for BodyFraming
Source§impl Hash for BodyFraming
impl Hash for BodyFraming
Source§impl PartialEq for BodyFraming
impl PartialEq for BodyFraming
impl StructuralPartialEq for BodyFraming
Auto Trait Implementations§
impl Freeze for BodyFraming
impl RefUnwindSafe for BodyFraming
impl Send for BodyFraming
impl Sync for BodyFraming
impl Unpin for BodyFraming
impl UnsafeUnpin for BodyFraming
impl UnwindSafe for BodyFraming
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