Skip to main content

Containerable

Trait Containerable 

Source
pub trait Containerable {
    const SIZE: usize;

    // Required methods
    fn from_bytes(bytes: &[u8]) -> Self;
    fn push_bytes(&self, buf: &mut BytesMut);
}

Required Associated Constants§

Required Methods§

Source

fn from_bytes(bytes: &[u8]) -> Self

Returns Self from bytes.

bytes is guaranteed to be Self::SIZE long.

Source

fn push_bytes(&self, buf: &mut BytesMut)

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl Containerable for i8

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for i16

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for i32

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for i64

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for i128

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for u16

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for u32

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for u64

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Source§

impl Containerable for u128

Source§

const SIZE: usize

Source§

fn from_bytes(bytes: &[u8]) -> Self

Source§

fn push_bytes(&self, buf: &mut BytesMut)

Implementors§