Enum ippacket::IpHeader

source ·
pub enum IpHeader {
    V4(Ipv4Header),
    V6(Ipv6Header),
}

Variants§

§

V4(Ipv4Header)

§

V6(Ipv6Header)

Implementations§

source§

impl IpHeader

source

pub fn with_bytes(bytes: Bytes) -> Result<(IpHeader, Bytes)>

source

pub fn src(&self) -> IpAddr

source

pub fn dest(&self) -> IpAddr

source

pub fn len(&self) -> usize

source

pub fn total_len(&self) -> Option<usize>

source

pub fn pseudo_iter(&self, len: usize) -> Chain<PairIter, IntoIter<u16>>

source

pub fn next(&self) -> IpProto

source

pub fn set_total_len(&mut self, len: usize)

source

pub fn set_next(&mut self, proto: IpProto)

Trait Implementations§

source§

impl Debug for IpHeader

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.