reth_db::table

Trait Decode

pub trait Decode:
    Sized
    + Send
    + Sync
    + Debug {
    // Required method
    fn decode(value: &[u8]) -> Result<Self, DatabaseError>;

    // Provided method
    fn decode_owned(value: Vec<u8>) -> Result<Self, DatabaseError> { ... }
}
Expand description

Trait that will transform the data to be read from the DB.

Required Methods§

fn decode(value: &[u8]) -> Result<Self, DatabaseError>

Decodes data coming from the database.

Provided Methods§

fn decode_owned(value: Vec<u8>) -> Result<Self, DatabaseError>

Decodes owned data coming from 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§

§

impl Decode for u8

§

fn decode(value: &[u8]) -> Result<u8, DatabaseError>

§

impl Decode for u16

§

fn decode(value: &[u8]) -> Result<u16, DatabaseError>

§

impl Decode for u32

§

fn decode(value: &[u8]) -> Result<u32, DatabaseError>

§

impl Decode for u64

§

fn decode(value: &[u8]) -> Result<u64, DatabaseError>

§

impl Decode for String

§

impl Decode for Vec<u8>

§

impl Decode for Address

§

fn decode(value: &[u8]) -> Result<Address, DatabaseError>

§

impl Decode for FixedBytes<32>

§

fn decode(value: &[u8]) -> Result<FixedBytes<32>, DatabaseError>

§

impl Decode for PruneSegment

§

fn decode(value: &[u8]) -> Result<PruneSegment, DatabaseError>

§

impl Decode for StoredNibbles

§

fn decode(value: &[u8]) -> Result<StoredNibbles, DatabaseError>

§

impl Decode for StoredNibblesSubKey

§

fn decode(value: &[u8]) -> Result<StoredNibblesSubKey, DatabaseError>

Implementors§