pub struct SubscriptionHandle {
pub subscription_id: SubscriptionId,
/* private fields */
}Expand description
Handle to a live subscription (RFC §13).
Dropping the handle removes the client-side forwarder and stops local
delivery; it does not send an unsubscribe envelope. Call
Self::unsubscribe to shut down gracefully with an explicit
unsubscribe on the wire.
Fields§
§subscription_id: SubscriptionIdThe subscription’s id.
Implementations§
Source§impl SubscriptionHandle
impl SubscriptionHandle
Sourcepub async fn next(&self) -> Option<Envelope>
pub async fn next(&self) -> Option<Envelope>
Receive the next envelope, or None when the subscription is
torn down.
Sourcepub async fn unsubscribe(self) -> Result<(), ARCPError>
pub async fn unsubscribe(self) -> Result<(), ARCPError>
Send an unsubscribe envelope and detach locally. The handle is
also detached on Drop, but explicit unsubscribe is the polite
shutdown.
§Errors
Returns ARCPError::Unavailable if the transport is already
closed.
Trait Implementations§
Source§impl Debug for SubscriptionHandle
impl Debug for SubscriptionHandle
Source§impl Drop for SubscriptionHandle
impl Drop for SubscriptionHandle
Auto Trait Implementations§
impl !Freeze for SubscriptionHandle
impl !RefUnwindSafe for SubscriptionHandle
impl Send for SubscriptionHandle
impl Sync for SubscriptionHandle
impl Unpin for SubscriptionHandle
impl UnsafeUnpin for SubscriptionHandle
impl !UnwindSafe 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