pub trait WriteToHeader { // Required method fn write_to(&self, writer: &mut Writer) -> Result<usize>; // Provided method fn to_bytes(&self) -> Result<Vec<u8>> { ... } }
Defines how to write a type as part of a binary PROXY protocol header.
Write this instance to the given Writer. The Writer returns an IO error when an individual byte slice is longer than u16::MAX. However, the total length of the buffer may exceed u16::MAX.
Writer
u16::MAX
Writes this instance to a temporary buffer and returns the buffer.