Struct etherparse::Ipv6HeaderSlice
source · [−]pub struct Ipv6HeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an ipv6 header of a network package.
Implementations
sourceimpl<'a> Ipv6HeaderSlice<'a>
impl<'a> Ipv6HeaderSlice<'a>
sourcepub fn from_slice(slice: &'a [u8]) -> Result<Ipv6HeaderSlice<'a>, ReadError>
pub fn from_slice(slice: &'a [u8]) -> Result<Ipv6HeaderSlice<'a>, ReadError>
Creates a slice containing an ipv6 header (without header extensions).
sourcepub fn slice(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
pub fn slice(&self) -> &'a [u8]ⓘNotable traits for &[u8]impl Read for &[u8]impl Write for &mut [u8]
Returns the slice containing the ipv6 header
sourcepub fn traffic_class(&self) -> u8
pub fn traffic_class(&self) -> u8
Read the “traffic class” field from the slice.
sourcepub fn flow_label(&self) -> u32
pub fn flow_label(&self) -> u32
Read the “flow label” field from the slice.
sourcepub fn payload_length(&self) -> u16
pub fn payload_length(&self) -> u16
Read the “payload length” field from the slice. The length should contain the length of all extension headers and payload.
sourcepub fn next_header(&self) -> u8
pub fn next_header(&self) -> u8
sourcepub fn hop_limit(&self) -> u8
pub fn hop_limit(&self) -> u8
Read the “hop limit” field from the slice. The hop limit specifies the number of hops the packet can take before it is discarded.
sourcepub fn source_addr(&self) -> Ipv6Addr
pub fn source_addr(&self) -> Ipv6Addr
Return the ipv6 source address as an std::net::Ipv6Addr
sourcepub fn destination(&self) -> [u8; 16]
pub fn destination(&self) -> [u8; 16]
Returns a slice containing the IPv6 destination address.
sourcepub fn destination_addr(&self) -> Ipv6Addr
pub fn destination_addr(&self) -> Ipv6Addr
Return the ipv6 destination address as an std::net::Ipv6Addr
sourcepub fn to_header(&self) -> Ipv6Header
pub fn to_header(&self) -> Ipv6Header
Decode all the fields and copy the results to a Ipv6Header struct
Trait Implementations
sourceimpl<'a> Clone for Ipv6HeaderSlice<'a>
impl<'a> Clone for Ipv6HeaderSlice<'a>
sourcefn clone(&self) -> Ipv6HeaderSlice<'a>
fn clone(&self) -> Ipv6HeaderSlice<'a>
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl<'a> Debug for Ipv6HeaderSlice<'a>
impl<'a> Debug for Ipv6HeaderSlice<'a>
sourceimpl<'a> PartialEq<Ipv6HeaderSlice<'a>> for Ipv6HeaderSlice<'a>
impl<'a> PartialEq<Ipv6HeaderSlice<'a>> for Ipv6HeaderSlice<'a>
sourcefn eq(&self, other: &Ipv6HeaderSlice<'a>) -> bool
fn eq(&self, other: &Ipv6HeaderSlice<'a>) -> bool
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
sourcefn ne(&self, other: &Ipv6HeaderSlice<'a>) -> bool
fn ne(&self, other: &Ipv6HeaderSlice<'a>) -> bool
This method tests for !=
.
impl<'a> Eq for Ipv6HeaderSlice<'a>
impl<'a> StructuralEq for Ipv6HeaderSlice<'a>
impl<'a> StructuralPartialEq for Ipv6HeaderSlice<'a>
Auto Trait Implementations
impl<'a> RefUnwindSafe for Ipv6HeaderSlice<'a>
impl<'a> Send for Ipv6HeaderSlice<'a>
impl<'a> Sync for Ipv6HeaderSlice<'a>
impl<'a> Unpin for Ipv6HeaderSlice<'a>
impl<'a> UnwindSafe for Ipv6HeaderSlice<'a>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more