[][src]Trait web3::DuplexTransport

pub trait DuplexTransport: Transport {
    type NotificationStream: Stream<Item = Value>;
    fn subscribe(&self, id: SubscriptionId) -> Result<Self::NotificationStream>;
fn unsubscribe(&self, id: SubscriptionId) -> Result<()>; }

A transport implementation supporting pub sub subscriptions.

Associated Types

type NotificationStream: Stream<Item = Value>

The type of stream this transport returns

Loading content...

Required methods

fn subscribe(&self, id: SubscriptionId) -> Result<Self::NotificationStream>

Add a subscription to this transport

fn unsubscribe(&self, id: SubscriptionId) -> Result<()>

Remove a subscription from this transport

Loading content...

Implementors

impl DuplexTransport for WebSocket[src]

impl<A, B, AStream, BStream> DuplexTransport for Either<A, B> where
    A: DuplexTransport<NotificationStream = AStream>,
    B: DuplexTransport<NotificationStream = BStream>,
    A::Out: 'static + Send,
    B::Out: 'static + Send,
    AStream: Stream<Item = Value> + 'static + Send,
    BStream: Stream<Item = Value> + 'static + Send
[src]

impl<X, T: ?Sized> DuplexTransport for X where
    T: DuplexTransport,
    X: Deref<Target = T>,
    X: Debug,
    X: Clone
[src]

Loading content...