pub trait ToDatabaseKey {
    type Type<'a>: AsRef<[u8]>
       where Self: 'a;

    // Required method
    fn database_key(&self) -> Self::Type<'_>;
}
Expand description

Some keys requires pre-processing that could change their type.

Required Associated Types§

source

type Type<'a>: AsRef<[u8]> where Self: 'a

A new type of prepared database key that can be converted into bytes.

Required Methods§

source

fn database_key(&self) -> Self::Type<'_>

Coverts the key into database key that supports byte presentation.

Implementations on Foreign Types§

source§

impl ToDatabaseKey for ContractId

§

type Type<'a> = &'a [u8]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for BlockHeight

§

type Type<'a> = [u8; 4]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for BlockId

§

type Type<'a> = &'a [u8]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for u64

§

type Type<'a> = [u8; 8]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for MessageId

§

type Type<'a> = &'a [u8]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for [u8; 65]

§

type Type<'a> = &'a [u8]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for TxId

§

type Type<'a> = &'a [u8]

source§

fn database_key(&self) -> Self::Type<'_>

source§

impl ToDatabaseKey for ()

§

type Type<'a> = &'a [u8]

source§

fn database_key(&self) -> Self::Type<'_>

Implementors§