reth_db_api::table

Trait Encode

Source
pub trait Encode:
    Send
    + Sync
    + Sized
    + Debug {
    type Encoded: AsRef<[u8]> + Into<Vec<u8>> + Send + Sync + Ord + Debug;

    // Required method
    fn encode(self) -> Self::Encoded;
}
Expand description

Trait that will transform the data to be saved in the DB.

Required Associated Types§

Source

type Encoded: AsRef<[u8]> + Into<Vec<u8>> + Send + Sync + Ord + Debug

Encoded type.

Required Methods§

Source

fn encode(self) -> Self::Encoded

Encodes data going into the database.

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 Encode for u8

Source§

type Encoded = [u8; 1]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for u16

Source§

type Encoded = [u8; 2]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for u32

Source§

type Encoded = [u8; 4]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for u64

Source§

type Encoded = [u8; 8]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for String

Source§

type Encoded = Vec<u8>

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for Vec<u8>

Source§

type Encoded = Vec<u8>

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for Address

Source§

type Encoded = [u8; 20]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for B256

Source§

type Encoded = [u8; 32]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for PruneSegment

Source§

type Encoded = [u8; 1]

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for StoredNibbles

Source§

type Encoded = Vec<u8>

Source§

fn encode(self) -> Self::Encoded

Source§

impl Encode for StoredNibblesSubKey

Source§

type Encoded = Vec<u8>

Source§

fn encode(self) -> Self::Encoded

Implementors§