pub trait MutablePacket: Packet {
// Required methods
fn packet_mut(&mut self) -> &mut [u8] ⓘ;
fn payload_mut(&mut self) -> &mut [u8] ⓘ;
// Provided method
fn clone_from<T: Packet>(&mut self, other: &T) { ... }
}
Expand description
Represents a generic, mutable, network packet.
Required Methods§
Sourcefn packet_mut(&mut self) -> &mut [u8] ⓘ
fn packet_mut(&mut self) -> &mut [u8] ⓘ
Retreive the underlying, mutable, buffer for the packet.
Sourcefn payload_mut(&mut self) -> &mut [u8] ⓘ
fn payload_mut(&mut self) -> &mut [u8] ⓘ
Retreive the mutable payload for the packet.
Provided Methods§
Sourcefn clone_from<T: Packet>(&mut self, other: &T)
fn clone_from<T: Packet>(&mut self, other: &T)
Initialize this packet by cloning another.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.