referrerpolicy=no-referrer-when-downgrade

StatementSpecApiServer

Trait StatementSpecApiServer 

Source
pub trait StatementSpecApiServer:
    Sized
    + Send
    + Sync
    + 'static {
    // Required methods
    fn statement_unstable_add_filter<'life0, 'life1, 'async_trait>(
        &'life0 self,
        ext: &'life1 Extensions,
        subscription: String,
        topic_filter: TopicFilter,
    ) -> Pin<Box<dyn Future<Output = Result<AddFilterResponse, Error>> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;
    fn statement_unstable_remove_filter(
        &self,
        ext: &Extensions,
        subscription: String,
        filter_id: String,
    ) -> Result<(), Error>;
    fn statement_unstable_submit(
        &self,
        encoded: Bytes,
    ) -> Result<SubmitOutcome, Error>;
    fn statement_unstable_subscribe<'life0, 'life1, 'async_trait>(
        &'life0 self,
        subscription_sink: PendingSubscriptionSink,
        ext: &'life1 Extensions,
    ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
       where Self: 'async_trait,
             'life0: 'async_trait,
             'life1: 'async_trait;

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

Server trait implementation for the StatementSpecApi RPC API.

Required Methods§

Source

fn statement_unstable_add_filter<'life0, 'life1, 'async_trait>( &'life0 self, ext: &'life1 Extensions, subscription: String, topic_filter: TopicFilter, ) -> Pin<Box<dyn Future<Output = Result<AddFilterResponse, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Attaches a filter to an existing subscription

Source

fn statement_unstable_remove_filter( &self, ext: &Extensions, subscription: String, filter_id: String, ) -> Result<(), Error>

Detaches a filter from a subscription

Source

fn statement_unstable_submit( &self, encoded: Bytes, ) -> Result<SubmitOutcome, Error>

Submits a SCALE-encoded statement to the store

Source

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

Opens a new statement subscription

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.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<B> StatementSpecApiServer for StatementSpec<B>
where B: StatementStore + Send + Sync + 'static, Arc<B>: MultiFilterSubscriptionApi,