Struct Schema

Source
pub struct Schema<T> { /* private fields */ }
Expand description

Information schema for indexes maintained by the Exonum core logic.

Indexes defined by this schema are present in the blockchain regardless of the deployed services and store general-purpose information, such as committed transactions.

Implementations§

Source§

impl<T: Access> Schema<T>

Source

pub fn transactions(&self) -> MapIndex<T::Base, Hash, Verified<AnyTx>>

Returns a table that represents a map with a key-value pair of a transaction hash and raw transaction message.

Source

pub fn call_records(&self, block_height: Height) -> Option<CallRecords<T>>

Returns a record of errors that occurred during execution of a particular block. If the block is not committed, returns None.

Source

pub fn transaction_result( &self, location: TxLocation, ) -> Option<Result<(), ExecutionError>>

Returns the result of the execution for a transaction with the specified location. If the location does not correspond to a transaction, returns None.

Source

pub fn transactions_len(&self) -> u64

Returns the number of committed transactions in the blockchain.

Source

pub fn transactions_pool(&self) -> KeySetIndex<T::Base, Hash>

Returns a table that represents a set of uncommitted transactions hashes.

§Stability

Since a signature of this method could be changed in the future due to performance reasons, this method is considered unstable.

Source

pub fn transactions_pool_len(&self) -> u64

Returns the number of transactions in the pool.

Source

pub fn transactions_locations(&self) -> MapIndex<T::Base, Hash, TxLocation>

Returns a table that keeps the block height and transaction position inside the block for every transaction hash.

Source

pub fn blocks(&self) -> MapIndex<T::Base, Hash, Block>

Returns a table that stores a block object for every block height.

Source

pub fn block_hashes_by_height(&self) -> ListIndex<T::Base, Hash>

Returns a table that keeps block hashes for corresponding block heights.

Source

pub fn block_transactions( &self, height: Height, ) -> ProofListIndex<T::Base, Hash>

Returns a table that keeps a list of transactions for each block.

Source

pub fn block_skip(&self) -> Option<Block>

Returns the recorded block skip, if any.

Source

pub fn block_skip_and_precommits(&self) -> Option<BlockProof>

Returns the recorded block skip together with authenticating information.

Source

pub fn precommits(&self, hash: &Hash) -> ListIndex<T::Base, Verified<Precommit>>

Returns a table that keeps a list of precommits for the block with the given hash.

Source

pub fn block_hash_by_height(&self, height: Height) -> Option<Hash>

Returns the block hash for the given height.

Source

pub fn block_and_precommits(&self, height: Height) -> Option<BlockProof>

Returns the block for the given height with the proof of its inclusion.

Source

pub fn last_block(&self) -> Block

Returns the latest committed block.

§Panics

Panics if the genesis block was not created.

Source

pub fn height(&self) -> Height

Returns the height of the latest committed block.

§Panics

Panics if invoked before the genesis block was created, e.g. within after_transactions hook for genesis block.

Source

pub fn next_height(&self) -> Height

Returns the height of the block to be committed.

Unlike height, this method never panics.

Source

pub fn consensus_config(&self) -> ConsensusConfig

Returns an actual consensus configuration of the blockchain.

§Panics

Panics if the genesis block was not created.

Source

pub fn validator_id(&self, service_public_key: PublicKey) -> Option<ValidatorId>

Attempts to find a ValidatorId by the provided service public key.

Trait Implementations§

Source§

impl<T: Clone> Clone for Schema<T>

Source§

fn clone(&self) -> Schema<T>

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<T: Debug> Debug for Schema<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T: Copy> Copy for Schema<T>

Auto Trait Implementations§

§

impl<T> Freeze for Schema<T>
where T: Freeze,

§

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

§

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

§

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

§

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

§

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

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dst: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

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

Source§

fn vzip(self) -> V