pub struct SubscriptionHandle { /* private fields */ }Expand description
An active subscriptions/listen request.
The handle exposes the JSON-RPC request ID used as the subscription ID,
the server’s acknowledged filter, graceful server completion, and explicit
cancellation. Dropping an active handle requests cancellation on a
best-effort basis; callers that need confirmation should call
cancel().
Implementations§
Source§impl SubscriptionHandle
impl SubscriptionHandle
Sourcepub async fn acknowledged(&mut self) -> Result<SubscriptionFilter>
pub async fn acknowledged(&mut self) -> Result<SubscriptionFilter>
Wait for the server’s mandatory first-message acknowledgment.
The returned filter is the subset the server agreed to honor.
Sourcepub async fn wait(self) -> Result<SubscriptionsListenResult>
pub async fn wait(self) -> Result<SubscriptionsListenResult>
Wait for the server to end the subscription gracefully.
An HTTP disconnect without a terminal response is reported as a transport error. Dropping this future drops the handle and cancels the subscription.
Trait Implementations§
Source§impl Drop for SubscriptionHandle
impl Drop for SubscriptionHandle
Auto Trait Implementations§
impl !RefUnwindSafe for SubscriptionHandle
impl !UnwindSafe for SubscriptionHandle
impl Freeze for SubscriptionHandle
impl Send for SubscriptionHandle
impl Sync for SubscriptionHandle
impl Unpin for SubscriptionHandle
impl UnsafeUnpin for SubscriptionHandle
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