pub enum NodePort<'a> {
Number(u16),
Obfuscated(&'a [u8]),
}Expand description
A node port: a number or an obfuscated identifier.
§Examples
use parse_net::{forwarded::{self, Node, NodePort}, Limits};
let lines: [&[u8]; 1] = [b"for=\"192.0.2.60:4711\";by=\"_proxy:_p1\""];
let e = forwarded::parse(&lines, &Limits::DEFAULT)?.iter().next().expect("one element");
assert!(matches!(e.for_, Some(Node::Addr(_, Some(NodePort::Number(4711))))));
assert_eq!(e.by, Some(Node::Obfuscated(b"_proxy", Some(NodePort::Obfuscated(b"_p1")))));Variants§
Number(u16)
A port number.
Obfuscated(&'a [u8])
An obfuscated port (_ and letters, digits, ., _, -).
Trait Implementations§
impl<'a> Copy for NodePort<'a>
impl<'a> Eq for NodePort<'a>
impl<'a> StructuralPartialEq for NodePort<'a>
Auto Trait Implementations§
impl<'a> Forget for NodePort<'a>
impl<'a> Freeze for NodePort<'a>
impl<'a> RefUnwindSafe for NodePort<'a>
impl<'a> Send for NodePort<'a>
impl<'a> Sync for NodePort<'a>
impl<'a> Unpin for NodePort<'a>
impl<'a> UnsafeUnpin for NodePort<'a>
impl<'a> UnwindSafe for NodePort<'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