pub struct EventSubscription<V> { /* private fields */ }Expand description
Application ownership of one running subscription.
Implementations§
Source§impl<V> EventSubscription<V>
impl<V> EventSubscription<V>
Sourcepub fn id(&self) -> SubscriptionId
pub fn id(&self) -> SubscriptionId
Opaque identity allocated by the pure client.
Sourcepub async fn recv(&mut self) -> Option<EventNotification<V>>
pub async fn recv(&mut self) -> Option<EventNotification<V>>
Receive one package value and release its bounded queue slot.
Sourcepub async fn next_state(&mut self) -> Option<StateChange>
pub async fn next_state(&mut self) -> Option<StateChange>
Receive one lifecycle fact.
Sourcepub async fn next_event(&mut self) -> Option<EventSubscriptionEvent<V>>
pub async fn next_event(&mut self) -> Option<EventSubscriptionEvent<V>>
Receive the next package value or lifecycle fact without favoring either channel.
This is the cancellation-safe choice for applications which must distinguish an initial
refusal from the first package snapshot. Self::recv and Self::next_state remain
available when an application intentionally observes only one side.
Sourcepub async fn unsubscribe(&self) -> Result<(), EventSubscriptionError>
pub async fn unsubscribe(&self) -> Result<(), EventSubscriptionError>
Send Expires 0 and wait only for command admission. Terminal NOTIFY or Timer N completes
the protocol operation and is observable through Self::next_state.
Trait Implementations§
Source§impl<V: Debug> Debug for EventSubscription<V>
impl<V: Debug> Debug for EventSubscription<V>
Source§impl<V> Drop for EventSubscription<V>
impl<V> Drop for EventSubscription<V>
Auto Trait Implementations§
impl<V> Freeze for EventSubscription<V>
impl<V> RefUnwindSafe for EventSubscription<V>
impl<V> Send for EventSubscription<V>where
V: Send,
impl<V> Sync for EventSubscription<V>where
V: Send,
impl<V> Unpin for EventSubscription<V>
impl<V> UnsafeUnpin for EventSubscription<V>
impl<V> UnwindSafe for EventSubscription<V>
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
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more