Skip to main content

ProtobufValue

Trait ProtobufValue 

Source
pub trait ProtobufValue: Sized {
    type Message: Message + Default;

    // Required methods
    fn to_proto(&self) -> Self::Message;
    fn from_proto(message: Self::Message) -> Result<Self, PersistenceError>;
}
Expand description

Defines the stored representation and domain validation for one type.

Required Associated Types§

Source

type Message: Message + Default

The protobuf message stored for this type.

Required Methods§

Source

fn to_proto(&self) -> Self::Message

Builds the stored protobuf message.

Source

fn from_proto(message: Self::Message) -> Result<Self, PersistenceError>

Builds the domain value and checks its construction constraints.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl ProtobufValue for Account

Source§

impl ProtobufValue for AccountCode

Source§

impl ProtobufValue for AccountStorageHeader

Source§

impl ProtobufValue for Asset

Source§

type Message = Asset

Source§

fn to_proto(&self) -> Self::Message

Source§

fn from_proto(message: Self::Message) -> Result<Self, PersistenceError>

Source§

impl ProtobufValue for BlockHeader

Source§

impl ProtobufValue for BlockSignatures

Source§

impl ProtobufValue for Note

Source§

type Message = Note

Source§

fn to_proto(&self) -> Self::Message

Source§

fn from_proto(message: Self::Message) -> Result<Self, PersistenceError>

Source§

impl ProtobufValue for NoteAssets

Source§

impl ProtobufValue for NoteAttachments

Source§

impl ProtobufValue for NoteDetails

Source§

impl ProtobufValue for NoteHeader

Source§

impl ProtobufValue for NoteScript

Source§

impl ProtobufValue for NoteStorage

Source§

impl ProtobufValue for PartialMmr

Source§

impl ProtobufValue for ProtocolConfig

Source§

impl ProtobufValue for ProvenTransaction

Source§

impl ProtobufValue for SignedBlock

Source§

impl ProtobufValue for SparseMerklePath

Source§

impl ProtobufValue for TransactionInputs

Source§

impl ProtobufValue for Vec<InputNoteCommitment>

Source§

impl ProtobufValue for Vec<NoteHeader>

Implementors§