Trait async_jsonrpc_client::PubsubTransport[][src]

pub trait PubsubTransport: Transport {
    type NotificationStream: Stream<Item = SubscriptionNotification>;
#[must_use]    fn subscribe<'life0, 'async_trait, M>(
        &'life0 self,
        subscribe_method: M,
        params: Option<Params>
    ) -> Pin<Box<dyn Future<Output = Result<(Id, Self::NotificationStream), Self::Error>> + Send + 'async_trait>>
    where
        M: Into<String> + Send,
        M: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
;
#[must_use] fn unsubscribe<'life0, 'async_trait, M>(
        &'life0 self,
        unsubscribe_method: M,
        subscription_id: Id
    ) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>>
    where
        M: Into<String> + Send,
        M: 'async_trait,
        'life0: 'async_trait,
        Self: 'async_trait
; }

A JSON-RPC 2.0 transport supporting subscriptions.

Associated Types

type NotificationStream: Stream<Item = SubscriptionNotification>[src]

The subscription stream.

Loading content...

Required methods

#[must_use]fn subscribe<'life0, 'async_trait, M>(
    &'life0 self,
    subscribe_method: M,
    params: Option<Params>
) -> Pin<Box<dyn Future<Output = Result<(Id, Self::NotificationStream), Self::Error>> + Send + 'async_trait>> where
    M: Into<String> + Send,
    M: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Add a subscription to this transport.

Will send unsubscribe request to the server when drop the notification stream.

#[must_use]fn unsubscribe<'life0, 'async_trait, M>(
    &'life0 self,
    unsubscribe_method: M,
    subscription_id: Id
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where
    M: Into<String> + Send,
    M: 'async_trait,
    'life0: 'async_trait,
    Self: 'async_trait, 
[src]

Send an unsubscribe request to the server manually.

Loading content...

Implementors

impl PubsubTransport for WsClient[src]

type NotificationStream = WsSubscription<SubscriptionNotification>

Loading content...