#[non_exhaustive]pub enum TargetForm {
Origin,
Absolute,
Authority,
Asterisk,
}Expand description
The form of a request target (RFC 9112 section 3.2).
§Examples
use http_net::{ServerConn, ServerEvent, TargetForm};
let mut conn = ServerConn::new();
let _ = conn.feed(b"OPTIONS * HTTP/1.1\r\nHost: a\r\n\r\n");
let ServerEvent::Request(req) = conn.poll().unwrap() else { panic!() };
assert_eq!(req.target_form(), TargetForm::Asterisk);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.
Origin
/path?query: the usual form for requests to an origin server.
Absolute
scheme://authority/path?query: requests to a proxy (and, per RFC
9112 section 3.2.2, acceptable to origin servers too).
Authority
host:port: only with CONNECT.
Asterisk
*: only with OPTIONS, for the server as a whole.
Trait Implementations§
Source§impl Clone for TargetForm
impl Clone for TargetForm
impl Copy for TargetForm
Source§impl Debug for TargetForm
impl Debug for TargetForm
impl Eq for TargetForm
Source§impl Hash for TargetForm
impl Hash for TargetForm
Source§impl PartialEq for TargetForm
impl PartialEq for TargetForm
impl StructuralPartialEq for TargetForm
Auto Trait Implementations§
impl Freeze for TargetForm
impl RefUnwindSafe for TargetForm
impl Send for TargetForm
impl Sync for TargetForm
impl Unpin for TargetForm
impl UnsafeUnpin for TargetForm
impl UnwindSafe for TargetForm
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