Trait LedgerInterface

Source
pub trait LedgerInterface: LedgerIntf + Clone {
    type W: WitnessGenerator<Fp>;
    type AccountUpdate: AccountUpdateInterface;
    type Account: AccountInterface;
    type Bool: BoolInterface;
    type InclusionProof;

    // Required methods
    fn empty(depth: usize) -> Self;
    fn get_account(
        &self,
        account_update: &Self::AccountUpdate,
        w: &mut Self::W,
    ) -> Result<(Self::Account, Self::InclusionProof), String>;
    fn set_account(
        &mut self,
        account: (Self::Account, Self::InclusionProof),
        w: &mut Self::W,
    ) -> Result<(), String>;
    fn check_inclusion(
        &self,
        account: &(Self::Account, Self::InclusionProof),
        w: &mut Self::W,
    );
    fn check_account(
        public_key: &CompressedPubKey,
        token_id: &TokenId,
        account: (&Self::Account, &Self::InclusionProof),
        w: &mut Self::W,
    ) -> Result<Self::Bool, String>;

    // Provided methods
    fn exists_no_check(self, _w: &mut Self::W) -> Self { ... }
    fn exists_no_check_on_bool(self, _b: Self::Bool, _w: &mut Self::W) -> Self { ... }
}

Required Associated Types§

Required Methods§

Source

fn empty(depth: usize) -> Self

Source

fn get_account( &self, account_update: &Self::AccountUpdate, w: &mut Self::W, ) -> Result<(Self::Account, Self::InclusionProof), String>

Source

fn set_account( &mut self, account: (Self::Account, Self::InclusionProof), w: &mut Self::W, ) -> Result<(), String>

Source

fn check_inclusion( &self, account: &(Self::Account, Self::InclusionProof), w: &mut Self::W, )

Source

fn check_account( public_key: &CompressedPubKey, token_id: &TokenId, account: (&Self::Account, &Self::InclusionProof), w: &mut Self::W, ) -> Result<Self::Bool, String>

Provided Methods§

Source

fn exists_no_check(self, _w: &mut Self::W) -> Self

Source

fn exists_no_check_on_bool(self, _b: Self::Bool, _w: &mut Self::W) -> 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§