[][src]Enum proxy_protocol::ProxyHeader

pub enum ProxyHeader {
    Version1 {
        family: ProxyAddressFamily,
        source: IpAddr,
        destination: IpAddr,
        source_port: u16,
        destination_port: u16,
    },
    Version2 {
        command: ProxyCommand,
        transport_protocol: ProxyTransportProtocol,
        address: ProxyAddress,
        source_port: Option<u16>,
        destination_port: Option<u16>,
    },
}

The PROXY header.

Variants

Version1

Fields of Version1

family: ProxyAddressFamily

If this is Unspec, all the other values are zeroed. In any other case, the rest of the values have proper values.

source: IpAddrdestination: IpAddrsource_port: u16destination_port: u16
Version2

Fields of Version2

command: ProxyCommandtransport_protocol: ProxyTransportProtocoladdress: ProxyAddresssource_port: Option<u16>destination_port: Option<u16>

Methods

impl ProxyHeader[src]

pub fn encode(self) -> Result<BytesMut, EncodingError>[src]

pub fn decode(buf: &mut Bytes) -> Result<Self, DecodingError>[src]

Trait Implementations

impl Clone for ProxyHeader[src]

impl Debug for ProxyHeader[src]

impl Eq for ProxyHeader[src]

impl PartialEq<ProxyHeader> for ProxyHeader[src]

impl StructuralEq for ProxyHeader[src]

impl StructuralPartialEq for ProxyHeader[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.