pub struct SystemClock;Expand description
Default implementation backed by std::time::SystemTime.
The conversion to u64 milliseconds saturates at both ends rather than
wrapping or panicking, so a misconfigured clock surfaces visibly instead of
silently stalling window advance:
- A time so far in the future that the millisecond count exceeds
u64::MAXsaturates tou64::MAX. A bareas u64cast would wrap to a small value, making a far-future clock masquerade as the distant past and stall the allocator — the opposite of the truth.u64::MAXinstead drives the allocator straight into visible window exhaustion. - A pre-Unix-epoch time saturates to
0(the earliest representable instant). Per the module docs, a clock pinned in the past stalls new windows until wall time catches up past the persisted high-water;0is the faithful representation of such a clock, not a swallowed error.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SystemClock
impl RefUnwindSafe for SystemClock
impl Send for SystemClock
impl Sync for SystemClock
impl Unpin for SystemClock
impl UnsafeUnpin for SystemClock
impl UnwindSafe for SystemClock
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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request