pub struct FakeClock { /* private fields */ }Expand description
Fake clock for deterministic unit and scenario testing.
Inject with crate::Database::open_with_clock. On a fresh database the
stamps are exactly what the caller sets, which is the point: a bitemporal
test that has to accommodate wall-clock recorded_at values cannot assert on
them, so most of the interesting divergence properties were previously
written against valid_time alone or against a hand-driven connection.
On a database that already holds rows, open_with_clock raises this
clock to their newest recorded_at before the actor starts — see
Clock::raise_floor. That is not optional and it does cost determinism:
reopening a populated database with a fake starting at the epoch would
otherwise abort the first concept write on trg_concepts_monotonic_ra. Tests
wanting exact stamps should start from an empty file.
Implementations§
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for FakeClock
impl RefUnwindSafe for FakeClock
impl Send for FakeClock
impl Sync for FakeClock
impl Unpin for FakeClock
impl UnsafeUnpin for FakeClock
impl UnwindSafe for FakeClock
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
T in a tonic::Request