Trait mutnet::udp::UdpMethods

source ·
pub trait UdpMethods: HeaderMetadata + PseudoHeaderChecksum + BufferAccess {
    // Provided methods
    fn udp_source_port(&self) -> u16 { ... }
    fn udp_destination_port(&self) -> u16 { ... }
    fn udp_length(&self) -> u16 { ... }
    fn udp_checksum(&self) -> u16 { ... }
    fn udp_calculate_checksum(&self) -> u16 { ... }
}
Expand description

Methods available for DataBuffer containing a Udp header.

Provided Methods§

source

fn udp_source_port(&self) -> u16

Returns the UDP source port.

source

fn udp_destination_port(&self) -> u16

Returns the UDP destination port.

source

fn udp_length(&self) -> u16

Returns the UDP length.

source

fn udp_checksum(&self) -> u16

Returns the UDP checksum.

source

fn udp_calculate_checksum(&self) -> u16

Calculates and returns the UDP checksum.

This takes lower layers into account. If there is an IPv4 or IPv6 layer present, the pseudo header will be included. If there is a NoPreviousHeader present, the pseudo header is set to zero.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<B, HM> UdpMethods for DataBuffer<B, HM>
where B: AsRef<[u8]>, HM: HeaderMetadata + HeaderMetadataMut + UdpMarker, DataBuffer<B, HM>: PseudoHeaderChecksum,