[][src]Struct etherparse::UdpHeaderSlice

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]

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_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<'a> Eq for UdpHeaderSlice<'a>[src]

impl<'a> PartialEq<UdpHeaderSlice<'a>> for UdpHeaderSlice<'a>[src]

impl<'a> Debug for UdpHeaderSlice<'a>[src]

Auto Trait Implementations

impl<'a> Send for UdpHeaderSlice<'a>

impl<'a> Sync for UdpHeaderSlice<'a>

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]