pub struct EventReader { /* private fields */ }Expand description
The consumer half of one subscription — C’s per-monitor view of event_read,
and the single owner of the EVENTS_OFF drain-or-suspend decision. Both CA
server monitor loops and every in-process consumer reach the gate through
here, so they cannot disagree about what a pause does.
Dropping it cancels the subscription’s queue slot (C db_cancel_event),
releasing its ring entries and its quota.
Implementations§
Source§impl EventReader
impl EventReader
Sourcepub async fn recv(&mut self) -> Option<MonitorEvent>
pub async fn recv(&mut self) -> Option<MonitorEvent>
Await this subscription’s next event, suspending exactly where C’s
event_read does (flowCtrlMode && nDuplicates == 0, no drain pass in
flight). None = producer gone and queue drained.
Sourcepub fn try_recv(&mut self) -> Result<MonitorEvent, TryRecvError>
pub fn try_recv(&mut self) -> Result<MonitorEvent, TryRecvError>
Non-blocking Self::recv.
Trait Implementations§
Source§impl Drop for EventReader
impl Drop for EventReader
Auto Trait Implementations§
impl Freeze for EventReader
impl RefUnwindSafe for EventReader
impl Send for EventReader
impl Sync for EventReader
impl Unpin for EventReader
impl UnsafeUnpin for EventReader
impl UnwindSafe for EventReader
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