Trait massa_api::api_trait::MassaApiServer

source ·
pub trait MassaApiServer: Sized + Send + Sync + 'static {
    // Required methods
    fn get_largest_stakers<'life0, 'async_trait>(
        &'life0 self,
        page_request: Option<ApiRequest>,
    ) -> Pin<Box<dyn Future<Output = RpcResult<PagedVecV2<(Address, u64)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_next_block_best_parents<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<(BlockId, u64)>>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn get_version<'life0, 'async_trait>(
        &'life0 self,
    ) -> Pin<Box<dyn Future<Output = RpcResult<Version>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_new_blocks<'life0, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
    ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_new_blocks_headers<'life0, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
    ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_new_filled_blocks<'life0, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
    ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;
    fn subscribe_new_operations<'life0, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
    ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait;

    // Provided method
    fn into_rpc(self) -> RpcModule<Self> { ... }
}
Expand description

Server trait implementation for the MassaApi RPC API.

Required Methods§

source

fn get_largest_stakers<'life0, 'async_trait>( &'life0 self, page_request: Option<ApiRequest>, ) -> Pin<Box<dyn Future<Output = RpcResult<PagedVecV2<(Address, u64)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the active stakers and their active roll counts for the current cycle sorted by largest roll counts.

source

fn get_next_block_best_parents<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Vec<(BlockId, u64)>>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get the ids of best parents for the next block to be produced along with their period

source

fn get_version<'life0, 'async_trait>( &'life0 self, ) -> Pin<Box<dyn Future<Output = RpcResult<Version>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Get Massa node version.

source

fn subscribe_new_blocks<'life0, 'async_trait>( &'life0 self, subscription_sink: PendingSubscriptionSink, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

New produced block.

source

fn subscribe_new_blocks_headers<'life0, 'async_trait>( &'life0 self, subscription_sink: PendingSubscriptionSink, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

New produced blocks headers.

source

fn subscribe_new_filled_blocks<'life0, 'async_trait>( &'life0 self, subscription_sink: PendingSubscriptionSink, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

New produced blocks with operations content.

source

fn subscribe_new_operations<'life0, 'async_trait>( &'life0 self, subscription_sink: PendingSubscriptionSink, ) -> Pin<Box<dyn Future<Output = SubscriptionResult> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

New produced operations.

Provided Methods§

source

fn into_rpc(self) -> RpcModule<Self>

Collects all the methods and subscriptions defined in the trait and adds them into a single RpcModule.

Object Safety§

This trait is not object safe.

Implementors§