Struct etherparse::UdpHeaderSlice
source · pub struct UdpHeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an udp header of a network package. Struct allows the selective read of fields in the header.
Implementations§
source§impl<'a> UdpHeaderSlice<'a>
impl<'a> UdpHeaderSlice<'a>
sourcepub fn from_slice(slice: &'a [u8]) -> Result<UdpHeaderSlice<'a>, ReadError>
pub fn from_slice(slice: &'a [u8]) -> Result<UdpHeaderSlice<'a>, ReadError>
Creates a slice containing an udp header.
sourcepub fn source_port(&self) -> u16
pub fn source_port(&self) -> u16
Reads the “udp source port” from the slice.
sourcepub fn destination_port(&self) -> u16
pub fn destination_port(&self) -> u16
Reads the “udp source port” from the slice.
Trait Implementations§
source§impl<'a> Clone for UdpHeaderSlice<'a>
impl<'a> Clone for UdpHeaderSlice<'a>
source§fn clone(&self) -> UdpHeaderSlice<'a>
fn clone(&self) -> UdpHeaderSlice<'a>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more