Struct jsonrpsee_core::server::Subscription
source · pub struct Subscription { /* private fields */ }
Available on crate feature
server
only.Expand description
Wrapper struct that maintains a subscription “mainly” for testing.
Implementations§
source§impl Subscription
impl Subscription
sourcepub fn subscription_id(&self) -> &SubscriptionId<'_>
pub fn subscription_id(&self) -> &SubscriptionId<'_>
Get the subscription ID
sourcepub async fn next<T: DeserializeOwned>(
&mut self,
) -> Option<Result<(T, SubscriptionId<'static>), MethodsError>>
pub async fn next<T: DeserializeOwned>( &mut self, ) -> Option<Result<(T, SubscriptionId<'static>), MethodsError>>
Receives the next value on the subscription if the value could be decoded as T.
Trait Implementations§
source§impl Debug for Subscription
impl Debug for Subscription
Auto Trait Implementations§
impl Freeze for Subscription
impl !RefUnwindSafe for Subscription
impl Send for Subscription
impl Sync for Subscription
impl Unpin for Subscription
impl !UnwindSafe for Subscription
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more