Trait TuringPacket

Source
pub trait TuringPacket<'tp> {
    // Required method
    fn into_packet<T>(value: T) -> &'tp [u8] ;
}
Expand description

Handles traits queries Ensures that a data structure is converted to bytes before it is sent over the wire

Required Methods§

Source

fn into_packet<T>(value: T) -> &'tp [u8]

§Converts a data structure into bytes in order to be sent over the wire
§Usage
use crate::TuringPacket;

struct Foo;

impl TuringPacket for Foo {
    fn into_packet(value: T) -> &'tp [u8] {
        value.as_bytes()
    }
}

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§