Trait BlocksApi

Source
pub trait BlocksApi:
    Send
    + Sync
    + 'static {
    type GetBlockRangeStream: Stream<Item = Result<BlockWithHeight, Status>> + Send + 'static;

    // Required methods
    fn get_block<'life0, 'async_trait>(
        &'life0 self,
        request: Request<BlockRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<BlockWithHeight>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_block_range<'life0, 'async_trait>(
        &'life0 self,
        request: Request<BlockRangeRequest>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<Self::GetBlockRangeStream>, Status>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_current_height<'life0, 'async_trait>(
        &'life0 self,
        request: Request<()>,
    ) -> Pin<Box<dyn Future<Output = Result<Response<u32>, 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 BlocksApiServer.

Required Associated Types§

Source

type GetBlockRangeStream: Stream<Item = Result<BlockWithHeight, Status>> + Send + 'static

Server streaming response type for the GetBlockRange method.

Required Methods§

Source

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

Source

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

Source

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

Implementors§