Trait web3::DuplexTransport [−][src]
pub trait DuplexTransport: Transport { type NotificationStream: Stream<Item = Value, Error = Error>; fn subscribe(&self, id: &SubscriptionId) -> Self::NotificationStream; fn unsubscribe(&self, id: &SubscriptionId); }
A transport implementation supporting pub sub subscriptions.
Associated Types
type NotificationStream: Stream<Item = Value, Error = Error>
The type of stream this transport returns
Required Methods
fn subscribe(&self, id: &SubscriptionId) -> Self::NotificationStream
Add a subscription to this transport
fn unsubscribe(&self, id: &SubscriptionId)
Remove a subscription from this transport
Implementors
impl DuplexTransport for Ipc type NotificationStream = Box<Stream<Item = Value, Error = Error> + Send + 'static>;
impl DuplexTransport for WebSocket type NotificationStream = Box<Stream<Item = Value, Error = Error> + Send + 'static>;
impl<X, T: ?Sized> DuplexTransport for X where
T: DuplexTransport,
X: Deref<Target = T>,
X: Debug,
X: Clone, type NotificationStream = T::NotificationStream;