[−][src]Struct exonum_cryptocurrency_advanced::schema::Schema
Database schema for the cryptocurrency.
Methods
impl<T> Schema<T> where
T: AsRef<dyn Snapshot>,
[src]
T: AsRef<dyn Snapshot>,
pub fn new(view: 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.
impl<'a> Schema<&'a mut Fork>
[src]
Implementation of mutable methods.
pub fn wallets_mut(&mut self) -> ProofMapIndex<&mut Fork, PublicKey, Wallet>
[src]
Returns mutable ProofMapIndex
with wallets.
pub fn wallet_history_mut(
&mut self,
public_key: &PublicKey
) -> ProofListIndex<&mut Fork, Hash>
[src]
&mut self,
public_key: &PublicKey
) -> ProofListIndex<&mut Fork, Hash>
Returns history for the wallet by the given public key.
pub fn increase_wallet_balance(
&mut self,
wallet: Wallet,
amount: u64,
transaction: &Hash
)
[src]
&mut self,
wallet: Wallet,
amount: u64,
transaction: &Hash
)
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]
&mut self,
wallet: Wallet,
amount: u64,
transaction: &Hash
)
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
Auto Trait Implementations
Blanket Implementations
impl<T> From for T
[src]
impl<T, U> Into for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T> Borrow for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T, U> TryInto for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Erased for T
impl<T> Same for T
type Output = T
Should always be Self