Struct etherparse::Ipv6HeaderSlice
source · pub struct Ipv6HeaderSlice<'a> { /* private fields */ }
Expand description
A slice containing an ipv6 header of a network package.
Implementations§
source§impl<'a> Ipv6HeaderSlice<'a>
impl<'a> Ipv6HeaderSlice<'a>
sourcepub fn from_slice(
slice: &'a [u8],
) -> Result<Ipv6HeaderSlice<'a>, HeaderSliceError>
pub fn from_slice( slice: &'a [u8], ) -> Result<Ipv6HeaderSlice<'a>, HeaderSliceError>
Creates a slice containing an ipv6 header (without header extensions).
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) -> Ipv6FlowLabel
pub fn flow_label(&self) -> Ipv6FlowLabel
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) -> IpNumber
pub fn next_header(&self) -> IpNumber
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
Available on crate feature std
only.
pub fn source_addr(&self) -> Ipv6Addr
std
only.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
Available on crate feature std
only.
pub fn destination_addr(&self) -> Ipv6Addr
std
only.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
sourcepub const fn header_len(&self) -> usize
pub const fn header_len(&self) -> usize
Returns the length of the IPv6 header in bytes (same as crate::Ipv6Header::LEN
).
Trait Implementations§
source§impl<'a> Clone for Ipv6HeaderSlice<'a>
impl<'a> Clone for Ipv6HeaderSlice<'a>
source§fn clone(&self) -> Ipv6HeaderSlice<'a>
fn clone(&self) -> Ipv6HeaderSlice<'a>
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl<'a> Debug for Ipv6HeaderSlice<'a>
impl<'a> Debug for Ipv6HeaderSlice<'a>
source§impl<'a> PartialEq for Ipv6HeaderSlice<'a>
impl<'a> PartialEq for Ipv6HeaderSlice<'a>
impl<'a> Copy for Ipv6HeaderSlice<'a>
impl<'a> Eq for Ipv6HeaderSlice<'a>
impl<'a> StructuralPartialEq for Ipv6HeaderSlice<'a>
Auto Trait Implementations§
impl<'a> Freeze for Ipv6HeaderSlice<'a>
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§
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)