pub trait PubsubClient: JsonRpcClient {
    type NotificationStream: Stream<Item = Box<RawValue>> + Send + Unpin;

    // Required methods
    fn subscribe<T: Into<U256>>(
        &self,
        id: T
    ) -> Result<Self::NotificationStream, Self::Error>;
    fn unsubscribe<T: Into<U256>>(&self, id: T) -> Result<(), Self::Error>;
}
Expand description

A transport implementation supporting pub sub subscriptions.

Required Associated Types§

source

type NotificationStream: Stream<Item = Box<RawValue>> + Send + Unpin

The type of stream this transport returns

Required Methods§

source

fn subscribe<T: Into<U256>>( &self, id: T ) -> Result<Self::NotificationStream, Self::Error>

Add a subscription to this transport

source

fn unsubscribe<T: Into<U256>>(&self, id: T) -> Result<(), Self::Error>

Remove a subscription from this transport

Object Safety§

This trait is not object safe.

Implementors§