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