cuprate_epee_encoding::container_as_blob

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", so 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§