Trait async_jsonrpc_client::PubsubTransport [−][src]
A JSON-RPC 2.0 transport supporting subscriptions.
Associated Types
type NotificationStream: Stream<Item = SubscriptionNotification>
[src]
The subscription stream.
Required methods
#[must_use]fn subscribe<'life0, 'async_trait, M>(
&'life0 self,
subscribe_method: M,
params: Option<Params>
) -> Pin<Box<dyn Future<Output = Result<(Id, Self::NotificationStream), Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
subscribe_method: M,
params: Option<Params>
) -> Pin<Box<dyn Future<Output = Result<(Id, Self::NotificationStream), Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Add a subscription to this transport.
Will send unsubscribe request to the server when drop the notification stream.
#[must_use]fn unsubscribe<'life0, 'async_trait, M>(
&'life0 self,
unsubscribe_method: M,
subscription_id: Id
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
unsubscribe_method: M,
subscription_id: Id
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Send an unsubscribe request to the server manually.
Implementors
impl PubsubTransport for WsClient
[src]
type NotificationStream = WsSubscription<SubscriptionNotification>
fn subscribe<'life0, 'async_trait, M>(
&'life0 self,
subscribe_method: M,
params: Option<Params>
) -> Pin<Box<dyn Future<Output = Result<(Id, Self::NotificationStream), Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
subscribe_method: M,
params: Option<Params>
) -> Pin<Box<dyn Future<Output = Result<(Id, Self::NotificationStream), Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
fn unsubscribe<'life0, 'async_trait, M>(
&'life0 self,
unsubscribe_method: M,
subscription_id: Id
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
[src]
&'life0 self,
unsubscribe_method: M,
subscription_id: Id
) -> Pin<Box<dyn Future<Output = Result<bool, Self::Error>> + Send + 'async_trait>> where
M: Into<String> + Send,
M: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,