pub struct Subscription { /* private fields */ }Expand description
Controls a registered callback subscription.
Dropping this handle unsubscribes immediately and without waiting for a
callback worker. Use Subscription::close when the caller must await the
retirement of an already running callback and observe any callback fault.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub fn id(&self) -> SubscriptionId
pub fn id(&self) -> SubscriptionId
Return the identifier of the controlled subscription.
Sourcepub fn unsubscribe(&self) -> bool
pub fn unsubscribe(&self) -> bool
Prevent future deliveries and release the subscription’s capacity.
This operation is synchronous and idempotent. It does not wait for a callback that is already running to finish.
Sourcepub async fn close(self) -> Result<()>
pub async fn close(self) -> Result<()>
Unsubscribe and wait for callback execution to retire.
The returned error preserves a callback panic or dispatch failure. A successful result means the callback is no longer running; it does not imply that a previously delivered callback completed application work after returning control to the SDK.