fedimint_core::db

Trait DatabaseKey

source
pub trait DatabaseKey: Sized {
    const NOTIFY_ON_MODIFY: bool = false;

    // Required method
    fn from_bytes(
        data: &[u8],
        modules: &ModuleDecoderRegistry,
    ) -> Result<Self, DecodingError>;
}
Expand description

DatabaseKey that represents the lookup structure for retrieving key/value pairs from the database.

Provided Associated Constants§

source

const NOTIFY_ON_MODIFY: bool = false

Send a notification to tasks waiting to be notified if the value of DatabaseKey is modified

For instance, this can be used to be notified when a key in the database is created. It is also possible to run a closure with the value of the DatabaseKey as parameter to verify some changes to that value.

Required Methods§

source

fn from_bytes( data: &[u8], modules: &ModuleDecoderRegistry, ) -> Result<Self, DecodingError>

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> DatabaseKey for T

source§

const NOTIFY_ON_MODIFY: bool = <T as DatabaseRecord>::NOTIFY_ON_MODIFY