pub enum ClockKind {
Sim(SimClock),
Real(RealClock),
}
Expand description
An adapter that allows us to control the behaviour of sleep between performing a real sleep and a sleep on the simnet
Variants§
Sim(SimClock)
Simulates a clock that uses the simnet’s current time as the source of truth
Real(RealClock)
Represents a real clock using tokio’s sleep functionality for production use.
Implementations§
Source§impl ClockKind
impl ClockKind
Sourcepub fn for_channel_addr(channel_addr: &ChannelAddr) -> Self
pub fn for_channel_addr(channel_addr: &ChannelAddr) -> Self
Returns the appropriate clock given the channel address kind a proc is being served on
Trait Implementations§
Source§impl Clock for ClockKind
impl Clock for ClockKind
Source§async fn non_advancing_sleep(&self, duration: Duration)
async fn non_advancing_sleep(&self, duration: Duration)
Initiates a sleep for the specified duration
Source§async fn sleep_until(&self, deadline: Instant)
async fn sleep_until(&self, deadline: Instant)
Sleep until the specified deadline.
Source§fn system_time_now(&self) -> SystemTime
fn system_time_now(&self) -> SystemTime
Get the current system time according to the clock
Source§impl<'de> Deserialize<'de> for ClockKind
impl<'de> Deserialize<'de> for ClockKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl TelemetryClock for ClockKind
impl TelemetryClock for ClockKind
fn now(&self) -> Instant
fn system_time_now(&self) -> SystemTime
Auto Trait Implementations§
impl Freeze for ClockKind
impl RefUnwindSafe for ClockKind
impl Send for ClockKind
impl Sync for ClockKind
impl Unpin for ClockKind
impl UnwindSafe for ClockKind
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
Source§impl<A, M> Handler<IndexedErasedUnbound<M>> for A
impl<A, M> Handler<IndexedErasedUnbound<M>> for A
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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