pub struct TelemetryReader<T, S> { /* private fields */ }Expand description
A single consumer cursor. User code chooses when to read and what to retain.
Implementations§
Source§impl<T, S: Copy> TelemetryReader<T, S>
impl<T, S: Copy> TelemetryReader<T, S>
Sourcepub fn try_read(&mut self) -> Option<TelemetryRead<'_, T>>
pub fn try_read(&mut self) -> Option<TelemetryRead<'_, T>>
Pulls the oldest retained frame without waiting. At most one borrowed frame can be held through this reader. Frame sequence wraps modulo u64; fewer than 2^64 publications may separate consecutive reads.
Sourcepub fn status(&mut self) -> S
pub fn status(&mut self) -> S
Observes/acknowledges coalesced current status independently of frames. A buffered frame may belong to an older session than this status.
Sourcepub fn is_closed(&self) -> bool
pub fn is_closed(&self) -> bool
True after publisher shutdown; any retained frames can still be read.
pub fn overwritten(&self) -> u64
Sourcepub fn register_waker(&self, waker: &Waker)
pub fn register_waker(&self, waker: &Waker)
Registers a one-shot payload-free wake. Re-arm before checking data and status. The waker must only schedule/unpark, never process user data. The post-registration readiness check prevents lost wakeups.
Sourcepub async fn ready(&mut self)
pub async fn ready(&mut self)
Waits asynchronously for unread data, changed status, or closure. This is level-triggered: drain data and observe status before waiting again.
Sourcepub fn wait_timeout(&mut self, timeout: Duration) -> bool
pub fn wait_timeout(&mut self, timeout: Duration) -> bool
Synchronous counterpart of ready, with a timeout for UI/input timers.
Returns false only on timeout. The first call on a thread allocates its
reusable thread waker; publication itself never allocates a notification.
Trait Implementations§
Source§impl<T, S> Drop for TelemetryReader<T, S>
impl<T, S> Drop for TelemetryReader<T, S>
Auto Trait Implementations§
impl<T, S> !RefUnwindSafe for TelemetryReader<T, S>
impl<T, S> !UnwindSafe for TelemetryReader<T, S>
impl<T, S> Freeze for TelemetryReader<T, S>
impl<T, S> Send for TelemetryReader<T, S>
impl<T, S> Sync for TelemetryReader<T, S>
impl<T, S> Unpin for TelemetryReader<T, S>
impl<T, S> UnsafeUnpin for TelemetryReader<T, S>
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
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> ⓘ
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> ⓘ
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