Struct etherparse::UdpHeaderSlice [−][src]
pub struct UdpHeaderSlice<'a> { /* fields omitted */ }
A slice containing an udp header of a network package. Struct allows the selective read of fields in the header.
Methods
impl<'a> UdpHeaderSlice<'a>
[src]
impl<'a> UdpHeaderSlice<'a>
pub fn from_slice(slice: &'a [u8]) -> Result<UdpHeaderSlice<'a>, ReadError>
[src]
pub fn from_slice(slice: &'a [u8]) -> Result<UdpHeaderSlice<'a>, ReadError>
Creates a slice containing an udp header.
pub fn slice(&self) -> &'a [u8]
[src]
pub fn slice(&self) -> &'a [u8]
Returns the slice containing the udp header
pub fn source_port(&self) -> u16
[src]
pub fn source_port(&self) -> u16
Reads the "udp source port" from the slice.
pub fn destination_port(&self) -> u16
[src]
pub fn destination_port(&self) -> u16
Reads the "udp source port" from the slice.
pub fn length(&self) -> u16
[src]
pub fn length(&self) -> u16
Reads the "udp source port" from the slice.
pub fn checksum(&self) -> u16
[src]
pub fn checksum(&self) -> u16
Reads the "udp source port" from the slice.
pub fn to_header(&self) -> UdpHeader
[src]
pub fn to_header(&self) -> UdpHeader
Decode all the fields and copy the results to a UdpHeader struct
Trait Implementations
impl<'a> Clone for UdpHeaderSlice<'a>
[src]
impl<'a> Clone for UdpHeaderSlice<'a>
fn clone(&self) -> UdpHeaderSlice<'a>
[src]
fn clone(&self) -> UdpHeaderSlice<'a>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
1.0.0
[src]Performs copy-assignment from source
. Read more
impl<'a> Debug for UdpHeaderSlice<'a>
[src]
impl<'a> Debug for UdpHeaderSlice<'a>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<'a> Eq for UdpHeaderSlice<'a>
[src]
impl<'a> Eq for UdpHeaderSlice<'a>
impl<'a> PartialEq for UdpHeaderSlice<'a>
[src]
impl<'a> PartialEq for UdpHeaderSlice<'a>
fn eq(&self, other: &UdpHeaderSlice<'a>) -> bool
[src]
fn eq(&self, other: &UdpHeaderSlice<'a>) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &UdpHeaderSlice<'a>) -> bool
[src]
fn ne(&self, other: &UdpHeaderSlice<'a>) -> bool
This method tests for !=
.
Auto Trait Implementations
impl<'a> Send for UdpHeaderSlice<'a>
impl<'a> Send for UdpHeaderSlice<'a>
impl<'a> Sync for UdpHeaderSlice<'a>
impl<'a> Sync for UdpHeaderSlice<'a>