Trait Info

Source
pub trait Info: Send + Sync {
    // Required method
    fn info<'life0, 'async_trait>(
        &'life0 self,
        info_request: RequestInfo,
    ) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided methods
    fn echo<'life0, 'async_trait>(
        &'life0 self,
        echo_request: RequestEcho,
    ) -> Pin<Box<dyn Future<Output = ResponseEcho> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn set_option<'life0, 'async_trait>(
        &'life0 self,
        _set_option_request: RequestSetOption,
    ) -> Pin<Box<dyn Future<Output = ResponseSetOption> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn query<'life0, 'async_trait>(
        &'life0 self,
        _query_request: RequestQuery,
    ) -> Pin<Box<dyn Future<Output = ResponseQuery> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
    fn flush<'life0, 'async_trait>(
        &'life0 self,
        _flush_request: RequestFlush,
    ) -> Pin<Box<dyn Future<Output = ResponseFlush> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait { ... }
}
Available on crate feature async-api only.
Expand description

Trait for initialization and for queries from the user.

Required Methods§

Source

fn info<'life0, 'async_trait>( &'life0 self, info_request: RequestInfo, ) -> Pin<Box<dyn Future<Output = ResponseInfo> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Return information about the application state.

§Crash Recovery

On startup, Tendermint calls the info method to get the latest committed state of the app. The app MUST return information consistent with the last block it successfully completed commit for.

If the app succesfully committed block H but not H+1, then

  • last_block_height = H
  • last_block_app_hash = <hash returned by Commit for block H>

If the app failed during the commit of block H, then

  • last_block_height = H-1
  • last_block_app_hash = <hash returned by Commit for block H-1, which is the hash in the header of block H>
§Equivalent to
async fn info(&self, info_request: RequestInfo) -> ResponseInfo

Provided Methods§

Source

fn echo<'life0, 'async_trait>( &'life0 self, echo_request: RequestEcho, ) -> Pin<Box<dyn Future<Output = ResponseEcho> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Echo a string to test abci client/server implementation.

§Equivalent to
async fn echo(&self, echo_request: RequestEcho) -> ResponseEcho
Source

fn set_option<'life0, 'async_trait>( &'life0 self, _set_option_request: RequestSetOption, ) -> Pin<Box<dyn Future<Output = ResponseSetOption> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Set non-consensus critical application specific options.

§Equivalent to
async fn set_option(&self, set_option_request: RequestSetOption) -> ResponseSetOption
Source

fn query<'life0, 'async_trait>( &'life0 self, _query_request: RequestQuery, ) -> Pin<Box<dyn Future<Output = ResponseQuery> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Query for data from the application at current or past height.

§Equivalent to
async fn query(&self, query_request: RequestQuery) -> ResponseQuery
Source

fn flush<'life0, 'async_trait>( &'life0 self, _flush_request: RequestFlush, ) -> Pin<Box<dyn Future<Output = ResponseFlush> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Signals that messages queued on the client should be flushed to the server.

§Equivalent to
async fn flush(&self, flush_request: RequestFlush) -> ResponseFlush

Implementors§