pub enum Preface {
H2,
Http1,
Partial,
Invalid,
}Expand description
What the first bytes of a connection are.
Variants§
H2
The HTTP/2 preface: hand the connection to the HTTP/2 codec, preface included.
Http1
Anything else: parse as HTTP/1.
Partial
Too few bytes to tell (a prefix of the preface, or nothing).
Invalid
The bytes start with the preface’s request line, PRI * HTTP/2.0, but the rest of the
preface is wrong: an HTTP/2 client with a broken preface. RFC 9113 §3.4 makes that a
connection error of type PROTOCOL_ERROR, so hand it to the HTTP/2 codec, which answers
GOAWAY(PROTOCOL_ERROR) and closes, rather than to the HTTP/1 parser.
Trait Implementations§
impl Copy for Preface
impl Eq for Preface
impl StructuralPartialEq for Preface
Auto Trait Implementations§
impl Forget for Preface
impl Freeze for Preface
impl Move for Preface
impl RefUnwindSafe for Preface
impl Send for Preface
impl Sync for Preface
impl Unpin for Preface
impl UnsafeUnpin for Preface
impl UnwindSafe for Preface
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