Packet

Trait Packet 

Source
pub trait Packet {
    type PacketType;

    // Required methods
    fn get_bytes(&self) -> Result<Vec<u8>, Error>;
    fn get_type(&self) -> Self::PacketType;

    // Provided method
    fn write_to<T: MutBits>(&self, out: &mut T) -> Result<(), Error> { ... }
}
Available on crate feature alloc only.

Required Associated Types§

Required Methods§

Source

fn get_bytes(&self) -> Result<Vec<u8>, Error>

Source

fn get_type(&self) -> Self::PacketType

Provided Methods§

Source

fn write_to<T: MutBits>(&self, out: &mut T) -> Result<(), Error>

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§