[][src]Struct exonum_cryptocurrency_advanced::schema::Schema

pub struct Schema<T> { /* fields omitted */ }

Database schema for the cryptocurrency.

Methods

impl<T> Schema<T> where
    T: IndexAccess
[src]

pub fn new(access: T) -> Self[src]

Creates a new schema from the database view.

pub fn wallets(&self) -> ProofMapIndex<T, PublicKey, Wallet>[src]

Returns ProofMapIndex with wallets.

pub fn wallet_history(&self, public_key: &PublicKey) -> ProofListIndex<T, Hash>[src]

Returns history of the wallet with the given public key.

pub fn wallet(&self, pub_key: &PublicKey) -> Option<Wallet>[src]

Returns wallet for the given public key.

pub fn state_hash(&self) -> Vec<Hash>[src]

Returns the state hash of cryptocurrency service.

pub fn increase_wallet_balance(
    &mut self,
    wallet: Wallet,
    amount: u64,
    transaction: &Hash
)
[src]

Increase balance of the wallet and append new record to its history.

Panics if there is no wallet with given public key.

pub fn decrease_wallet_balance(
    &mut self,
    wallet: Wallet,
    amount: u64,
    transaction: &Hash
)
[src]

Decrease balance of the wallet and append new record to its history.

Panics if there is no wallet with given public key.

pub fn create_wallet(&mut self, key: &PublicKey, name: &str, transaction: &Hash)[src]

Create new wallet and append first record to its history.

Trait Implementations

impl<T> AsMut<T> for Schema<T>[src]

impl<T: Debug> Debug for Schema<T>[src]

Auto Trait Implementations

impl<T> Sync for Schema<T> where
    T: Sync

impl<T> Send for Schema<T> where
    T: Send

impl<T> Unpin for Schema<T> where
    T: Unpin

impl<T> RefUnwindSafe for Schema<T> where
    T: RefUnwindSafe

impl<T> UnwindSafe for Schema<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> Erased for T