Trait PubsubClient

Source
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

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 PubsubClient for Ipc

Available on crate feature ipc and (Unix or Windows) only.
Source§

impl PubsubClient for Ws

Available on crate feature legacy-ws only.
Source§

impl<C> PubsubClient for QuorumProvider<C>
where C: PubsubClientWrapper,

Source§

type NotificationStream = QuorumStream