libpacket_core

Trait MutablePacket

Source
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§

Source

fn packet_mut(&mut self) -> &mut [u8]

Retreive the underlying, mutable, buffer for the packet.

Source

fn payload_mut(&mut self) -> &mut [u8]

Retreive the mutable payload for the packet.

Provided Methods§

Source

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.

Implementors§