reth_db::table

Trait Decode

Source
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§

Source

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

Decodes data coming from the database.

Provided Methods§

Source

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§

Source§

impl Decode for u8

Source§

impl Decode for u16

Source§

impl Decode for u32

Source§

impl Decode for u64

Source§

impl Decode for StoredNibbles

Source§

impl Decode for StoredNibblesSubKey

Source§

impl Decode for String

Source§

impl Decode for Vec<u8>

Source§

impl Decode for Address

Source§

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

Source§

impl Decode for FixedBytes<32>

Source§

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

Source§

impl Decode for PruneSegment

Source§

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

Implementors§