pub struct TimeValue<T> {
pub timestamp: Timestamp,
pub value: T,
}
Expand description
A timestamped value.
This is a data value along with the time at which it was created/collected.
Fields§
§timestamp: Timestamp
The timestamp at which the value was collected.
value: T
The value
Implementations§
Source§impl<T> TimeValue<T>
impl<T> TimeValue<T>
Sourcepub fn with_timestamp<S>(ts: S, val: T) -> Self
pub fn with_timestamp<S>(ts: S, val: T) -> Self
Creates a value with the specified timestamp
Sourcepub fn into_tuple(self) -> (Timestamp, T)
pub fn into_tuple(self) -> (Timestamp, T)
Converts the value into a tuple
Sourcepub fn into_tuple_f64(self) -> (f64, T)
pub fn into_tuple_f64(self) -> (f64, T)
Converts the value into a tuple
Trait Implementations§
impl<T: Copy> Copy for TimeValue<T>
Time values that contain copyable data are also copyable.
Auto Trait Implementations§
impl<T> Freeze for TimeValue<T>where
T: Freeze,
impl<T> RefUnwindSafe for TimeValue<T>where
T: RefUnwindSafe,
impl<T> Send for TimeValue<T>where
T: Send,
impl<T> Sync for TimeValue<T>where
T: Sync,
impl<T> Unpin for TimeValue<T>where
T: Unpin,
impl<T> UnwindSafe for TimeValue<T>where
T: UnwindSafe,
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