reth_db_api::table

Trait Decode

Source
pub trait Decode:
    Send
    + Sync
    + Sized
    + 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§

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

Source§

impl Decode for u16

Source§

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

Source§

impl Decode for u32

Source§

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

Source§

impl Decode for u64

Source§

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

Source§

impl Decode for String

Source§

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

Source§

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

Source§

impl Decode for Vec<u8>

Source§

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

Source§

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

Source§

impl Decode for Address

Source§

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

Source§

impl Decode for B256

Source§

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

Source§

impl Decode for PruneSegment

Source§

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

Source§

impl Decode for StoredNibbles

Source§

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

Source§

impl Decode for StoredNibblesSubKey

Source§

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

Implementors§