pub struct Sources<T> { /* private fields */ }Expand description
Several sources for one kind of value.
Implementations§
Source§impl<T: Clone> Sources<T>
impl<T: Clone> Sources<T>
Sourcepub fn with(self, id: impl Into<String>, rank: u8, good_for: Duration) -> Self
pub fn with(self, id: impl Into<String>, rank: u8, good_for: Duration) -> Self
Adds a source, or changes the standing of one already known.
Sourcepub fn record(&mut self, id: &str, value: T, at: Duration)
pub fn record(&mut self, id: &str, value: T, at: Duration)
Records a reading. at is the receiving clock’s time when it
arrived.
An undeclared source is accepted automatically, at the lowest rank and with the same limit as the most recently declared source, so a source added at runtime is still recorded.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Sources<T>
impl<T> RefUnwindSafe for Sources<T>where
T: RefUnwindSafe,
impl<T> Send for Sources<T>where
T: Send,
impl<T> Sync for Sources<T>where
T: Sync,
impl<T> Unpin for Sources<T>where
T: Unpin,
impl<T> UnsafeUnpin for Sources<T>
impl<T> UnwindSafe for Sources<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