[−][src]Struct exonum_cryptocurrency_advanced::schema::Schema
Database schema for the cryptocurrency.
Methods
impl<T> Schema<T> where
T: IndexAccess,
[src]
T: IndexAccess,
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]
&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
impl<T> Sync for Schema<T> where
T: Sync,
T: Sync,
impl<T> Send for Schema<T> where
T: Send,
T: Send,
impl<T> Unpin for Schema<T> where
T: Unpin,
T: Unpin,
impl<T> RefUnwindSafe for Schema<T> where
T: RefUnwindSafe,
T: RefUnwindSafe,
impl<T> UnwindSafe for Schema<T> where
T: UnwindSafe,
T: UnwindSafe,
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> 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, U> TryInto<U> 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> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,