Skip to main content

Receipt

Trait Receipt 

Source
pub trait Receipt {
    const TAG: u8;

    // Required method
    fn as_bytes(&self) -> &[u8];
}
Expand description

Trait for types that can be emitted as receipts.

Implement this for your domain-specific receipt structs to get typed emission via emit_typed_receipt().

Required Associated Constants§

Source

const TAG: u8

Receipt type tag for indexer discrimination.

Required Methods§

Source

fn as_bytes(&self) -> &[u8]

Serialize the receipt to bytes.

The returned slice must be valid for the lifetime of self.

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§