#[non_exhaustive]pub enum Parsed<T> {
Complete {
head: T,
len: usize,
},
Partial,
}Expand description
The result of a stateless parse: a complete head and how many input
bytes it took, or Partial when the input ends before the head does.
§Examples
use http_net::{FieldSpan, Limits, Parsed, parse_request_head};
let mut fields = [FieldSpan::default(); 16];
let parsed = parse_request_head(b"GET / HTTP/1.1\r\nHo", &Limits::new(), &mut fields)?;
assert!(matches!(parsed, Parsed::Partial));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.
Complete
A whole head: len bytes of the input, any leading empty lines
included; the body (if any) starts there.
Partial
The input ends before the head does: call again with more input.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Parsed<T>where
T: Freeze,
impl<T> RefUnwindSafe for Parsed<T>where
T: RefUnwindSafe,
impl<T> Send for Parsed<T>where
T: Send,
impl<T> Sync for Parsed<T>where
T: Sync,
impl<T> Unpin for Parsed<T>where
T: Unpin,
impl<T> UnsafeUnpin for Parsed<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for Parsed<T>where
T: UnwindSafe,
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