Struct capsules_extra::net::ipv6::IPPayload
source · pub struct IPPayload<'a> {
pub header: TransportHeader,
pub payload: &'a mut [u8],
}
Expand description
The IPPayload
struct contains a TransportHeader
and a mutable buffer
(the payload).
Fields§
§header: TransportHeader
§payload: &'a mut [u8]
Implementations§
source§impl<'a> IPPayload<'a>
impl<'a> IPPayload<'a>
sourcepub fn new(header: TransportHeader, payload: &'a mut [u8]) -> IPPayload<'a>
pub fn new(header: TransportHeader, payload: &'a mut [u8]) -> IPPayload<'a>
This function constructs a new IPPayload
struct
§Arguments
header
- A TransportHeader
for the IPPayload
payload
- A reference to a mutable buffer for the raw payload
sourcepub fn set_payload(
&mut self,
transport_header: TransportHeader,
payload: &SubSliceMut<'static, u8>,
) -> (u8, u16)
pub fn set_payload( &mut self, transport_header: TransportHeader, payload: &SubSliceMut<'static, u8>, ) -> (u8, u16)
This function sets the payload for the IPPayload
, and sets both the
TransportHeader and copies the provided payload buffer.
§Arguments
transport_header
- The new TransportHeader
header for the payload
payload
- The payload to be copied into the IPPayload
§Return Value
(u8, u16)
- Returns a tuple of the ip6_nh
type of the
transport_header
and the total length of the IPPayload
(when serialized)
Auto Trait Implementations§
impl<'a> Freeze for IPPayload<'a>
impl<'a> RefUnwindSafe for IPPayload<'a>
impl<'a> Send for IPPayload<'a>
impl<'a> Sync for IPPayload<'a>
impl<'a> Unpin for IPPayload<'a>
impl<'a> !UnwindSafe for IPPayload<'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
Mutably borrows from an owned value. Read more