Trait tendermint_rpc::SubscriptionClient[][src]

pub trait SubscriptionClient {
#[must_use]    fn subscribe<'life0, 'async_trait>(
        &'life0 self,
        query: Query
    ) -> Pin<Box<dyn Future<Output = Result<Subscription>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn unsubscribe<'life0, 'async_trait>(
        &'life0 self,
        query: Query
    ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
    where
        'life0: 'async_trait,
        Self: 'async_trait
;
fn close(self) -> Result<()>; }

A client that exclusively provides Event subscription capabilities, without any other RPC method support.

Required methods

#[must_use]fn subscribe<'life0, 'async_trait>(
    &'life0 self,
    query: Query
) -> Pin<Box<dyn Future<Output = Result<Subscription>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

/subscribe: subscribe to receive events produced by the given query.

#[must_use]fn unsubscribe<'life0, 'async_trait>(
    &'life0 self,
    query: Query
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

/unsubscribe: unsubscribe from events relating to the given query.

This method is particularly useful when you want to terminate multiple Subscriptions to the same Query simultaneously, or if you’ve joined multiple Subscriptions together using select_all and you no longer have access to the individual Subscription instances to terminate them separately.

fn close(self) -> Result<()>[src]

Subscription clients will usually have long-running underlying transports that will need to be closed at some point.

Loading content...

Implementors

impl SubscriptionClient for WebSocketClient[src]

impl<M: MockRequestMatcher> SubscriptionClient for MockClient<M>[src]

Loading content...