[][src]Struct exonum_rust_runtime::api::ServiceApiState

pub struct ServiceApiState { /* fields omitted */ }

Provide the current blockchain state snapshot to API handlers.

This structure allows a service API handler to interact with the service instance and other parts of the blockchain.

Methods

impl ServiceApiState[src]

pub fn data(&self) -> BlockchainData<&dyn Snapshot>[src]

Returns readonly access to blockchain data.

pub fn service_data(&self) -> Prefixed<&dyn Snapshot>[src]

Returns readonly access to the data of the executing service.

pub fn snapshot(&self) -> &dyn Snapshot[src]

Returns the access to the entire blockchain snapshot. Use data or service_data for more structure snapshot presentations.

pub fn service_key(&self) -> PublicKey[src]

Returns the service key of this node.

pub fn instance(&self) -> &InstanceDescriptor[src]

Returns information about the executing service.

pub fn status(&self) -> &InstanceStatus[src]

Returns the current status of the service.

pub fn broadcaster(&self) -> Option<Broadcaster>[src]

Returns a transaction broadcaster if the current node is a validator and the service is active (i.e., can process transactions). If these conditions do not hold, returns None.

pub fn generic_broadcaster(&self) -> Broadcaster[src]

Returns a transaction broadcaster regardless of the node status (validator or auditor) and the service status (active or not).

Safety

Transactions for non-active services will not be broadcast successfully; they will be filtered on the receiving nodes as ones that cannot (currently) be processed.

pub fn moved_permanently(&self, new_endpoint: &str) -> MovedPermanentlyError[src]

Creates a new builder for MovedPermanently response.

Trait Implementations

impl Debug for ServiceApiState[src]

Auto Trait Implementations

Blanket Implementations

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

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

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

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<V, T> VZip<V> for T where
    V: MultiLane<T>,