reth_db::table

Trait Encode

Source
pub trait Encode:
    Sized
    + Send
    + Sync
    + 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) -> <u8 as Encode>::Encoded

Source§

impl Encode for u16

Source§

type Encoded = [u8; 2]

Source§

fn encode(self) -> <u16 as Encode>::Encoded

Source§

impl Encode for u32

Source§

type Encoded = [u8; 4]

Source§

fn encode(self) -> <u32 as Encode>::Encoded

Source§

impl Encode for u64

Source§

type Encoded = [u8; 8]

Source§

fn encode(self) -> <u64 as Encode>::Encoded

Source§

impl Encode for StoredNibbles

Source§

impl Encode for StoredNibblesSubKey

Source§

impl Encode for String

Source§

impl Encode for Vec<u8>

Source§

impl Encode for Address

Source§

type Encoded = [u8; 20]

Source§

fn encode(self) -> <Address as Encode>::Encoded

Source§

impl Encode for FixedBytes<32>

Source§

type Encoded = [u8; 32]

Source§

fn encode(self) -> <FixedBytes<32> as Encode>::Encoded

Source§

impl Encode for PruneSegment

Source§

type Encoded = [u8; 1]

Source§

fn encode(self) -> <PruneSegment as Encode>::Encoded

Implementors§