Struct pnet_packet::udp::UdpPacket [] [src]

pub struct UdpPacket<'p> { /* fields omitted */ }

A structure enabling manipulation of on the wire packets

Methods

impl<'a> UdpPacket<'a>
[src]

[src]

Constructs a new UdpPacket. If the provided buffer is less than the minimum required packet size, this will return None.

[src]

Constructs a new UdpPacket. If the provided buffer is less than the minimum required packet size, this will return None. With this constructor the UdpPacket will own its own data and the underlying buffer will be dropped when the UdpPacket is.

[src]

Maps from a UdpPacket to a UdpPacket

[src]

Maps from a UdpPacket to a UdpPacket while consuming the source

[src]

The minimum size (in bytes) a packet of this type can be. It's based on the total size of the fixed-size fields.

[src]

The size (in bytes) of a Udp instance when converted into a byte-array

[src]

Get the source field. This field is always stored big-endian within the struct, but this accessor returns host order.

[src]

Get the destination field. This field is always stored big-endian within the struct, but this accessor returns host order.

[src]

Get the length field. This field is always stored big-endian within the struct, but this accessor returns host order.

[src]

Get the checksum field. This field is always stored big-endian within the struct, but this accessor returns host order.

Trait Implementations

impl<'p> PartialEq for UdpPacket<'p>
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

[src]

This method tests for !=.

impl<'a> PacketSize for UdpPacket<'a>
[src]

[src]

Get the calculated size of the packet

impl<'a> Packet for UdpPacket<'a>
[src]

[src]

Retreive the underlying buffer for the packet

[src]

Retreive the payload for the packet

impl<'p> FromPacket for UdpPacket<'p>
[src]

The type of the packet to convert from

[src]

Converts a wire-format packet to #[packet] struct format

impl<'p> Debug for UdpPacket<'p>
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<'p> Send for UdpPacket<'p>

impl<'p> Sync for UdpPacket<'p>