Struct etherparse::UdpHeaderSlice [−][src]
A slice containing an udp header of a network package. Struct allows the selective read of fields in the header.
Implementations
impl<'a> UdpHeaderSlice<'a>
[src]
pub fn from_slice(slice: &'a [u8]) -> Result<UdpHeaderSlice<'a>, ReadError>
[src]
Creates a slice containing an udp header.
pub fn slice(&self) -> &'a [u8]
[src]
Returns the slice containing the udp header
pub fn source_port(&self) -> u16
[src]
Reads the "udp source port" from the slice.
pub fn destination_port(&self) -> u16
[src]
Reads the "udp destination port" from the slice.
pub fn length(&self) -> u16
[src]
Reads the "length" from the slice.
pub fn checksum(&self) -> u16
[src]
Reads the "checksum" from the slice.
pub fn to_header(&self) -> UdpHeader
[src]
Decode all the fields and copy the results to a UdpHeader struct
Trait Implementations
impl<'a> Clone for UdpHeaderSlice<'a>
[src]
fn clone(&self) -> UdpHeaderSlice<'a>
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<'a> Debug for UdpHeaderSlice<'a>
[src]
impl<'a> Eq for UdpHeaderSlice<'a>
[src]
impl<'a> PartialEq<UdpHeaderSlice<'a>> for UdpHeaderSlice<'a>
[src]
fn eq(&self, other: &UdpHeaderSlice<'a>) -> bool
[src]
fn ne(&self, other: &UdpHeaderSlice<'a>) -> bool
[src]
impl<'a> StructuralEq for UdpHeaderSlice<'a>
[src]
impl<'a> StructuralPartialEq for UdpHeaderSlice<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for UdpHeaderSlice<'a>
[src]
impl<'a> Send for UdpHeaderSlice<'a>
[src]
impl<'a> Sync for UdpHeaderSlice<'a>
[src]
impl<'a> Unpin for UdpHeaderSlice<'a>
[src]
impl<'a> UnwindSafe for UdpHeaderSlice<'a>
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,