ic_web3_rs

Trait DuplexTransport

Source
pub trait DuplexTransport: Transport {
    type NotificationStream: Stream<Item = Value>;

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

A transport implementation supporting pub sub subscriptions.

Required Associated Types§

Source

type NotificationStream: Stream<Item = Value>

The type of stream this transport returns

Required Methods§

Source

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

Add a subscription to this transport

Source

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

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<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,

Source§

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