pub struct InstantTimestamped<T, R: Runtime> {
pub value: T,
pub timestamp: R::Instant,
}Expand description
A timestamped value using a Timer’s Instant type for monotonic time operations.
This type wraps a value with a timestamp from the provided Timer implementation,
implementing the Timestamped trait. This enables time-based
operators like delay, debounce, and throttle.
§Example
use fluxion_stream_time::InstantTimestamped;
use fluxion_runtime::impls::tokio::{TokioRuntime, TokioTimer};
use fluxion_runtime::timer::Timer;
let timer = TokioTimer;
let item: InstantTimestamped<i32, TokioRuntime> = InstantTimestamped::new(42, timer.now());Fields§
§value: T§timestamp: R::InstantImplementations§
Trait Implementations§
Source§impl<T, R: Runtime> Deref for InstantTimestamped<T, R>
impl<T, R: Runtime> Deref for InstantTimestamped<T, R>
Source§impl<T, R: Runtime> HasTimestamp for InstantTimestamped<T, R>
impl<T, R: Runtime> HasTimestamp for InstantTimestamped<T, R>
Source§impl<T, R: Runtime> Ord for InstantTimestamped<T, R>where
T: Ord,
impl<T, R: Runtime> Ord for InstantTimestamped<T, R>where
T: Ord,
Source§impl<T, R: Runtime> PartialOrd for InstantTimestamped<T, R>where
T: PartialOrd,
impl<T, R: Runtime> PartialOrd for InstantTimestamped<T, R>where
T: PartialOrd,
Source§impl<T, R: Runtime> Timestamped for InstantTimestamped<T, R>where
T: Clone,
impl<T, R: Runtime> Timestamped for InstantTimestamped<T, R>where
T: Clone,
Source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Consumes self and returns the inner value.
For wrapper types like
Sequenced<T>, this extracts T.
For domain types where Inner = Self, this typically returns self.Source§fn with_timestamp(inner: Self::Inner, timestamp: Self::Timestamp) -> Self
fn with_timestamp(inner: Self::Inner, timestamp: Self::Timestamp) -> Self
Creates a new instance wrapping the given value with the specified timestamp.
impl<T, R: Runtime> Eq for InstantTimestamped<T, R>where
T: Eq,
Auto Trait Implementations§
impl<T, R> Freeze for InstantTimestamped<T, R>
impl<T, R> RefUnwindSafe for InstantTimestamped<T, R>
impl<T, R> Send for InstantTimestamped<T, R>where
T: Send,
impl<T, R> Sync for InstantTimestamped<T, R>where
T: Sync,
impl<T, R> Unpin for InstantTimestamped<T, R>
impl<T, R> UnwindSafe for InstantTimestamped<T, R>
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