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>, LenError>
pub fn from_slice(slice: &'a [u8]) -> Result<UdpHeaderSlice<'a>, LenError>
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 destination 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 moresource§impl<'a> Debug for UdpHeaderSlice<'a>
impl<'a> Debug for UdpHeaderSlice<'a>
source§impl<'a> PartialEq for UdpHeaderSlice<'a>
impl<'a> PartialEq for UdpHeaderSlice<'a>
source§fn eq(&self, other: &UdpHeaderSlice<'a>) -> bool
fn eq(&self, other: &UdpHeaderSlice<'a>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.impl<'a> Eq for UdpHeaderSlice<'a>
impl<'a> StructuralPartialEq for UdpHeaderSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for UdpHeaderSlice<'a>
impl<'a> RefUnwindSafe for UdpHeaderSlice<'a>
impl<'a> Send for UdpHeaderSlice<'a>
impl<'a> Sync for UdpHeaderSlice<'a>
impl<'a> Unpin for UdpHeaderSlice<'a>
impl<'a> UnwindSafe for UdpHeaderSlice<'a>
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