Struct rips_packets::ethernet::MutEthernetPacket
[−]
[src]
pub struct MutEthernetPacket<'a>(_);
Methods
impl<'a> MutEthernetPacket<'a>
[src]
pub const MIN_LEN: usize
MIN_LEN: usize = 14
The minimum number of bytes in this type of packet. Usually equal to the header size of the protocol.
pub fn new(data: &'a mut [u8]) -> Option<MutEthernetPacket<'a>>
[src]
Creates a new mutable packet based on the given backing slice. Returns None
if
the buffer is shorter than the minimal length of this packet.
pub unsafe fn new_unchecked(data: &'a mut [u8]) -> MutEthernetPacket<'a>
[src]
Creates a new mutable packet based on the given backing slice without checking its length first. If the slice is too short, a subsequent read from a field might result in invalid memory access.
pub fn as_immutable(&'a self) -> EthernetPacket<'a>
[src]
Returns an immutable version of the same packet and backed by the same byte slice. Used to access the getters.
pub fn data(&mut self) -> &mut [u8]
[src]
Returns a mutable reference to the slice backing this packet.
pub fn header(&mut self) -> &mut [u8]
[src]
Returns a mutable slice to the part of the backing data that represents the header.
This is simply everything up until min_len()
.
pub fn payload(&mut self) -> &mut [u8]
[src]
Returns a mutable slice to the payload part of the backing data. This is simply everything after the header.