pub struct Subscription { /* private fields */ }Expand description
Active subscription receiving events from one or more eventgroups.
Created via SubscriptionBuilder::subscribe. Call next
to receive events.
§Lifecycle
When dropped, sends StopSubscribeEventgroup (TTL=0) for all eventgroups.
If the runtime is already shut down, cleanup relies on server-side TTL expiry.
Implementations§
Source§impl Subscription
impl Subscription
Sourcepub async fn next(&mut self) -> Option<Event>
pub async fn next(&mut self) -> Option<Event>
Receive the next event from any subscribed eventgroup.
Returns None if the subscription has ended.
Sourcepub fn eventgroups(&self) -> &[EventgroupId]
pub fn eventgroups(&self) -> &[EventgroupId]
Get the list of eventgroup IDs in this subscription.
Trait Implementations§
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