VersionedLedgerTransactionHashesVersion

Trait VersionedLedgerTransactionHashesVersion 

Source
pub trait VersionedLedgerTransactionHashesVersion {
    type Versioned: Versioned;
    type OwnedSborVariant;
    type BorrowedSborVariant<'a>
       where Self: 'a;

    const DISCRIMINATOR: u8;

    // Required methods
    fn as_encodable_variant(&self) -> Self::BorrowedSborVariant<'_>;
    fn from_decoded_variant(variant: Self::OwnedSborVariant) -> Self
       where Self: Sized;
    fn into_versioned(self) -> Self::Versioned;
}

Required Associated Constants§

Required Associated Types§

Required Methods§

Source

fn as_encodable_variant(&self) -> Self::BorrowedSborVariant<'_>

Can be used to encode the type as a variant under the Versioned type, without needing to clone, like this: encoder.encode(x.as_encodable_variant()).

Source

fn from_decoded_variant(variant: Self::OwnedSborVariant) -> Self
where Self: Sized,

Can be used to decode the type from an encoded variant, like this: X::from_decoded_variant(decoder.decode()?).

Source

fn into_versioned(self) -> Self::Versioned

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 VersionedLedgerTransactionHashesVersion for LedgerTransactionHashesV1

Source§

const DISCRIMINATOR: u8 = 0u8

Source§

type Versioned = VersionedLedgerTransactionHashes

Source§

type OwnedSborVariant = SborFixedEnumVariant<radix_transactions::::model::ledger_transaction::{impl#91}::OwnedSborVariant::{constant#0}, (LedgerTransactionHashesV1,)>

Source§

type BorrowedSborVariant<'a> = SborFixedEnumVariant<radix_transactions::::model::ledger_transaction::{impl#91}::BorrowedSborVariant::{constant#0}, (&'a LedgerTransactionHashesV1,)> where LedgerTransactionHashesV1: 'a

Source§

impl VersionedLedgerTransactionHashesVersion for LedgerTransactionHashesV2

Source§

const DISCRIMINATOR: u8 = 1u8

Source§

type Versioned = VersionedLedgerTransactionHashes

Source§

type OwnedSborVariant = SborFixedEnumVariant<radix_transactions::::model::ledger_transaction::{impl#92}::OwnedSborVariant::{constant#0}, (LedgerTransactionHashesV2,)>

Source§

type BorrowedSborVariant<'a> = SborFixedEnumVariant<radix_transactions::::model::ledger_transaction::{impl#92}::BorrowedSborVariant::{constant#0}, (&'a LedgerTransactionHashesV2,)> where LedgerTransactionHashesV2: 'a