pub struct Header { /* private fields */ }
Implementations§
Source§impl Header
impl Header
pub fn new( command: Command, transport_protocol: TransportProtocol, address_family: AddressFamily, src: impl Into<SocketAddr>, dst: impl Into<SocketAddr>, ) -> Self
pub fn new_tcp_ipv4_proxy( src: impl Into<SocketAddr>, dst: impl Into<SocketAddr>, ) -> Self
pub fn add_tlv(&mut self, typ: u8, value: impl AsRef<[u8]>)
pub fn add_typed_tlv<T: Tlv>(&mut self, tlv: T)
pub fn write_to(&self, wrt: &mut impl Write) -> Result<()>
pub async fn write_to_tokio( &self, wrt: &mut (impl AsyncWrite + Unpin), ) -> Result<()>
pub fn has_tlv<T: Tlv>(&self) -> bool
Sourcepub fn add_crc23c_checksum(&mut self)
pub fn add_crc23c_checksum(&mut self)
Calculates and adds a crc32c TLV to the PROXY header.
Uses method defined in spec.
If this is not called last thing it will be wrong.
pub fn validate_crc32c_tlv(&self) -> Option<bool>
Trait Implementations§
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