Skip to main content

Api

pub trait Api:
    Send
    + Sync
    + 'static {
    // Required methods
    fn status<'life0, 'async_trait>(
        &'life0 self,
        request: Request<()>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<ValidatorStatus>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn submit_proven_transaction<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ProvenTransaction>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn sign_block<'life0, 'async_trait>(
        &'life0 self,
        request: Request<ProposedBlock>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<SignBlockResponse>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
}
Expand description

Generated trait containing gRPC methods that should be implemented for use with ApiServer.

Required Methods§

Source

fn status<'life0, 'async_trait>( &'life0 self, request: Request<()>, ) -> Pin<Box<dyn Future<Output = Result<Response<ValidatorStatus>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Returns the status info of the validator.

Source

fn submit_proven_transaction<'life0, 'async_trait>( &'life0 self, request: Request<ProvenTransaction>, ) -> Pin<Box<dyn Future<Output = Result<Response<()>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Submits a transaction to the validator.

Source

fn sign_block<'life0, 'async_trait>( &'life0 self, request: Request<ProposedBlock>, ) -> Pin<Box<dyn Future<Output = Result<Response<SignBlockResponse>, Status>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Validates and signs a proposed block, returning the signature and the signed block commitment.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§

Source§

impl<T> Api for T
where T: ApiService + Send + Sync + 'static,