Trait substrate_api_client::rpc::HandleSubscription
source · pub trait HandleSubscription<Notification: DeserializeOwned> {
// Required methods
fn next<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<Result<Notification>>> + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait;
fn unsubscribe<'async_trait>(
self
) -> Pin<Box<dyn Future<Output = Result<()>> + 'async_trait>>
where Self: 'async_trait;
}
Expand description
Trait to use the full functionality of jsonrpseee Subscription type without actually enforcing it.
Required Methods§
sourcefn next<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<Result<Notification>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn next<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Option<Result<Notification>>> + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Returns the next notification from the stream.
This may return None
if the subscription has been terminated,
which may happen if the channel becomes full or is dropped.
Note: This has an identical signature to the [StreamExt::next
]
method (and delegates to that). Import [StreamExt
] if you’d like
access to other stream combinator methods.