Trait ic_web3_rs::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§
sourcetype NotificationStream: Stream<Item = Value>
type NotificationStream: Stream<Item = Value>
The type of stream this transport returns
Required Methods§
sourcefn subscribe(&self, id: SubscriptionId) -> Result<Self::NotificationStream>
fn subscribe(&self, id: SubscriptionId) -> Result<Self::NotificationStream>
Add a subscription to this transport
sourcefn unsubscribe(&self, id: SubscriptionId) -> Result<()>
fn unsubscribe(&self, id: SubscriptionId) -> Result<()>
Remove a subscription from this transport