[−][src]Struct utsl_hybrid_clocks::OffsetLimiter
A wrapper around Clock
that will refuse updates outside of our tolerance.
Implementations
impl<S: ClockSource> OffsetLimiter<S>
[src]
pub fn new(clock: Clock<S>, max_offset: S::Delta) -> Self
[src]
pub fn observe(&mut self, msg: &Timestamp<S::Time>) -> Result<()>
[src]
Accepts a timestamp from an incoming message, and updates the clock
so that further calls to now
will always return a timestamp that
happens-after
either locally generated timestamps or that of the
input message. Returns an Error iff the delta from our local lock to
the observed timestamp is greater than our configured limit.
pub fn now(&mut self) -> Result<Timestamp<S::Time>>
[src]
Creates a unique monotonic timestamp suitable for annotating messages we send.
pub fn into_inner(self) -> Clock<S>
[src]
Extract the inner Clock
pub fn inner(&self) -> &Clock<S>
[src]
Get a reference to the inner Clock
pub fn inner_mut(&mut self) -> &mut Clock<S>
[src]
Get a mutable reference to the inner Clock
Trait Implementations
impl<S: Clone + ClockSource> Clone for OffsetLimiter<S> where
S::Delta: Clone,
[src]
S::Delta: Clone,
fn clone(&self) -> OffsetLimiter<S>
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl<S: Debug + ClockSource> Debug for OffsetLimiter<S> where
S::Delta: Debug,
[src]
S::Delta: Debug,
Auto Trait Implementations
impl<S> RefUnwindSafe for OffsetLimiter<S> where
S: RefUnwindSafe,
<S as ClockSource>::Delta: RefUnwindSafe,
<S as ClockSource>::Time: RefUnwindSafe,
S: RefUnwindSafe,
<S as ClockSource>::Delta: RefUnwindSafe,
<S as ClockSource>::Time: RefUnwindSafe,
impl<S> Send for OffsetLimiter<S> where
S: Send,
<S as ClockSource>::Delta: Send,
<S as ClockSource>::Time: Send,
S: Send,
<S as ClockSource>::Delta: Send,
<S as ClockSource>::Time: Send,
impl<S> Sync for OffsetLimiter<S> where
S: Sync,
<S as ClockSource>::Delta: Sync,
<S as ClockSource>::Time: Sync,
S: Sync,
<S as ClockSource>::Delta: Sync,
<S as ClockSource>::Time: Sync,
impl<S> Unpin for OffsetLimiter<S> where
S: Unpin,
<S as ClockSource>::Delta: Unpin,
<S as ClockSource>::Time: Unpin,
S: Unpin,
<S as ClockSource>::Delta: Unpin,
<S as ClockSource>::Time: Unpin,
impl<S> UnwindSafe for OffsetLimiter<S> where
S: UnwindSafe,
<S as ClockSource>::Delta: UnwindSafe,
<S as ClockSource>::Time: UnwindSafe,
S: UnwindSafe,
<S as ClockSource>::Delta: UnwindSafe,
<S as ClockSource>::Time: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,