pub struct Header { /* private fields */ }
Expand description
The PROXY Protocol v2 header.
For encoding and decoding stuffs, please refer to codec::HeaderEncoder
and codec::HeaderDecoder
.
Implementations§
Source§impl Header
impl Header
Sourcepub const MAGIC: &'static [u8; 12] = b"\r\n\r\n\x00\r\nQUIT\n"
pub const MAGIC: &'static [u8; 12] = b"\r\n\r\n\x00\r\nQUIT\n"
The magic bytes that identify the PROXY Protocol v2 header.
Sourcepub const fn new_local() -> Self
pub const fn new_local() -> Self
Creates a new Header
with Command::Local
Sourcepub const fn new_proxy(protocol: Protocol, address_pair: AddressPair) -> Self
pub const fn new_proxy(protocol: Protocol, address_pair: AddressPair) -> Self
Creates a new Header
with Command::Proxy
Sourcepub const fn address_pair(&self) -> &AddressPair
pub const fn address_pair(&self) -> &AddressPair
Returns the address pair of the header.
Trait Implementations§
impl Eq for Header
impl StructuralPartialEq for Header
Auto Trait Implementations§
impl Freeze for Header
impl RefUnwindSafe for Header
impl Send for Header
impl Sync for Header
impl Unpin for Header
impl UnwindSafe for Header
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