pub trait UtxoData: Encode + Decode {
    const TYPE_ID: [u8; 4];
}
Expand description

A trait that must be implemented for any data that can be contained in a UTXO. It is not recommended to implement this trait directly for primitive types, but rather to use the newtype pattern: https://doc.rust-lang.org/book/ch19-04-advanced-types.html. Using a new type allows strong type disambiguation between bespoke use-cases in which the same primitive may be stored.

Required Associated Constants§

source

const TYPE_ID: [u8; 4]

A unique identifier for this type. For now choosing this value and making sure it really is unique is the problem of the developer. Ideally this would be better.

Object Safety§

This trait is not object safe.

Implementors§

source§

impl UtxoData for Bogus

source§

const TYPE_ID: [u8; 4] = _