pub struct EngineSubscription { /* private fields */ }Expand description
Subscription to protocol-neutral engine change events.
Returned by crate::Engine::subscribe. The subscription holds a slot
permit until dropped — drop it promptly when the caller is done so other
subscribers can join.
Implementations§
Source§impl EngineSubscription
impl EngineSubscription
Sourcepub async fn recv(&mut self) -> Result<ChangeEvent, SubscriptionRecvError>
pub async fn recv(&mut self) -> Result<ChangeEvent, SubscriptionRecvError>
Returns the next change event for this subscription.
Drains the replay queue first (in increasing event id order), then
switches to the live broadcast stream. If the caller passed since to
crate::Engine::subscribe, events with id <= since are filtered.
§Errors
SubscriptionRecvError::Closedwhen the engine shut down or the underlying channel closed. Terminal: subsequent calls keep returningClosed.SubscriptionRecvError::Laggedwhen the broadcast ring buffer overflowed and events were lost. Recoverable: the next call resumes with fresh events.
Auto Trait Implementations§
impl Freeze for EngineSubscription
impl RefUnwindSafe for EngineSubscription
impl Send for EngineSubscription
impl Sync for EngineSubscription
impl Unpin for EngineSubscription
impl UnsafeUnpin for EngineSubscription
impl UnwindSafe for EngineSubscription
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