pub struct Timed<P, T = Timestamp> {
pub value: P,
pub at: Option<T>,
}Expand description
A value to publish, and optionally when it was captured.
T is the clock the time is on: a raw Timestamp by default, or whatever a higher layer
maps onto one (moq-mux takes a std::time::Instant). Converts from a bare payload (bytes,
or a &V to serialize), so a producer taking one still accepts the plain value, stamped when
written.
Fields§
§value: PThe value to publish.
at: Option<T>When the value was captured. None stamps it when written.
Implementations§
Trait Implementations§
impl<P: Copy, T: Copy> Copy for Timed<P, T>
Auto Trait Implementations§
impl<P, T> Freeze for Timed<P, T>
impl<P, T> RefUnwindSafe for Timed<P, T>
impl<P, T> Send for Timed<P, T>
impl<P, T> Sync for Timed<P, T>
impl<P, T> Unpin for Timed<P, T>
impl<P, T> UnsafeUnpin for Timed<P, T>
impl<P, T> UnwindSafe for Timed<P, T>
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