Struct smoltcp::wire::Ipv6Packet [−][src]
A read/write wrapper around an Internet Protocol version 6 packet buffer.
Implementations
impl<T: AsRef<[u8]>> Packet<T>
[src]
pub fn new_unchecked(buffer: T) -> Packet<T>
[src]
Create a raw octet buffer with an IPv6 packet structure.
pub fn new_checked(buffer: T) -> Result<Packet<T>>
[src]
Shorthand for a combination of new_unchecked and check_len.
pub fn check_len(&self) -> Result<()>
[src]
Ensure that no accessor method will panic if called.
Returns Err(Error::Truncated)
if the buffer is too short.
The result of this check is invalidated by calling set_payload_len.
pub fn into_inner(self) -> T
[src]
Consume the packet, returning the underlying buffer.
pub fn header_len(&self) -> usize
[src]
Return the header length.
pub fn version(&self) -> u8
[src]
Return the version field.
pub fn traffic_class(&self) -> u8
[src]
Return the traffic class.
pub fn flow_label(&self) -> u32
[src]
Return the flow label field.
pub fn payload_len(&self) -> u16
[src]
Return the payload length field.
pub fn total_len(&self) -> usize
[src]
Return the payload length added to the known header length.
pub fn next_header(&self) -> Protocol
[src]
Return the next header field.
pub fn hop_limit(&self) -> u8
[src]
Return the hop limit field.
pub fn src_addr(&self) -> Address
[src]
Return the source address field.
pub fn dst_addr(&self) -> Address
[src]
Return the destination address field.
impl<'a, T: AsRef<[u8]> + ?Sized> Packet<&'a T>
[src]
impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T>
[src]
pub fn set_version(&mut self, value: u8)
[src]
Set the version field.
pub fn set_traffic_class(&mut self, value: u8)
[src]
Set the traffic class field.
pub fn set_flow_label(&mut self, value: u32)
[src]
Set the flow label field.
pub fn set_payload_len(&mut self, value: u16)
[src]
Set the payload length field.
pub fn set_next_header(&mut self, value: Protocol)
[src]
Set the next header field.
pub fn set_hop_limit(&mut self, value: u8)
[src]
Set the hop limit field.
pub fn set_src_addr(&mut self, value: Address)
[src]
Set the source address field.
pub fn set_dst_addr(&mut self, value: Address)
[src]
Set the destination address field.
pub fn payload_mut(&mut self) -> &mut [u8]
[src]
Return a mutable pointer to the payload.
Trait Implementations
impl<T: AsRef<[u8]>> AsRef<[u8]> for Packet<T>
[src]
impl<T: Clone + AsRef<[u8]>> Clone for Packet<T>
[src]
impl<T: Debug + AsRef<[u8]>> Debug for Packet<T>
[src]
impl<'a, T: AsRef<[u8]> + ?Sized> Display for Packet<&'a T>
[src]
impl<T: PartialEq + AsRef<[u8]>> PartialEq<Packet<T>> for Packet<T>
[src]
impl<T: AsRef<[u8]>> PrettyPrint for Packet<T>
[src]
fn pretty_print(
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
[src]
buffer: &dyn AsRef<[u8]>,
f: &mut Formatter<'_>,
indent: &mut PrettyIndent
) -> Result
impl<T: AsRef<[u8]>> StructuralPartialEq for Packet<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Packet<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> Send for Packet<T> where
T: Send,
T: Send,
impl<T> Sync for Packet<T> where
T: Sync,
T: Sync,
impl<T> Unpin for Packet<T> where
T: Unpin,
T: Unpin,
impl<T> UnwindSafe for Packet<T> where
T: UnwindSafe,
T: UnwindSafe,
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> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
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>,