fedimint_core::db

Trait DatabaseValue

Source
pub trait DatabaseValue: Sized + Debug {
    // Required methods
    fn from_bytes(
        data: &[u8],
        modules: &ModuleDecoderRegistry,
    ) -> Result<Self, DecodingError>;
    fn to_bytes(&self) -> Vec<u8> ;
}
Expand description

DatabaseValue that represents the value structure of database records.

Required Methods§

Source

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

Source

fn to_bytes(&self) -> Vec<u8>

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.

Implementors§

Source§

impl<T> DatabaseValue for T
where T: Debug + Encodable + Decodable,