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)

Object Safety§

This trait is not object safe.

Implementations on Foreign Types§

source§

impl Containerable for i8

source§

const SIZE: usize = 1usize

source§

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

source§

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

source§

impl Containerable for i16

source§

const SIZE: usize = 2usize

source§

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

source§

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

source§

impl Containerable for i32

source§

const SIZE: usize = 4usize

source§

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

source§

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

source§

impl Containerable for i64

source§

const SIZE: usize = 8usize

source§

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

source§

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

source§

impl Containerable for i128

source§

const SIZE: usize = 16usize

source§

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

source§

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

source§

impl Containerable for u16

source§

const SIZE: usize = 2usize

source§

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

source§

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

source§

impl Containerable for u32

source§

const SIZE: usize = 4usize

source§

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

source§

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

source§

impl Containerable for u64

source§

const SIZE: usize = 8usize

source§

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

source§

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

source§

impl Containerable for u128

source§

const SIZE: usize = 16usize

source§

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

source§

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

Implementors§