pub struct ServerClock { /* private fields */ }Expand description
Tracks the offset between the local clock and a venue’s server clock.
Implementations§
Source§impl ServerClock
impl ServerClock
Sourcepub fn new() -> ServerClock
pub fn new() -> ServerClock
A clock with zero offset (assumes local time until synced).
Sourcepub fn sync(&mut self, local_ms: i64, server_ms: i64)
pub fn sync(&mut self, local_ms: i64, server_ms: i64)
Record a sync point: the local time at which the venue reported
server_ms. The offset becomes server_ms - local_ms.
Sourcepub fn server_time_ms(&self, local_ms: i64) -> i64
pub fn server_time_ms(&self, local_ms: i64) -> i64
The server-adjusted timestamp for a given local time.
Trait Implementations§
Source§impl Debug for ServerClock
impl Debug for ServerClock
Source§impl Default for ServerClock
impl Default for ServerClock
Source§fn default() -> ServerClock
fn default() -> ServerClock
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ServerClock
impl RefUnwindSafe for ServerClock
impl Send for ServerClock
impl Sync for ServerClock
impl Unpin for ServerClock
impl UnsafeUnpin for ServerClock
impl UnwindSafe for ServerClock
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more