pub struct Element<'a> {
pub for_: Option<Node<'a>>,
pub by: Option<Node<'a>>,
pub host: Option<HostPort<'a>>,
pub proto: Option<Proto>,
}Expand description
One Forwarded element.
§Examples
use parse_net::{forwarded::{self, Proto}, Host, Limits};
let lines: [&[u8]; 1] = [b"for=192.0.2.60;proto=https;host=example.com"];
let e = forwarded::parse(&lines, &Limits::DEFAULT)?.iter().next().expect("one element");
assert_eq!(e.proto, Some(Proto::Https));
assert_eq!(e.host.map(|h| h.host), Some(Host::Name(b"example.com")));
assert!(e.by.is_none());Fields§
§for_: Option<Node<'a>>for=: the client of this hop.
by: Option<Node<'a>>by=: the proxy’s receiving interface.
host: Option<HostPort<'a>>host=: the Host the proxy received.
proto: Option<Proto>proto=.
Trait Implementations§
impl<'a> Copy for Element<'a>
impl<'a> Eq for Element<'a>
impl<'a> StructuralPartialEq for Element<'a>
Auto Trait Implementations§
impl<'a> Freeze for Element<'a>
impl<'a> RefUnwindSafe for Element<'a>
impl<'a> Send for Element<'a>
impl<'a> Sync for Element<'a>
impl<'a> Unpin for Element<'a>
impl<'a> UnsafeUnpin for Element<'a>
impl<'a> UnwindSafe for Element<'a>
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