MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / with_clock

Method with_clock

libatomic/src/daemon/sandbox_grants.rs:357–362  ·  view source on GitHub ↗

A registry reading time from `clock` instead of the system clock (tests; a host with its own trusted clock).

(clock: Arc<dyn Fn() -> DateTime<Utc> + Send + Sync>)

Source from the content-addressed store, hash-verified

355 /// A registry reading time from `clock` instead of the system clock
356 /// (tests; a host with its own trusted clock).
357 pub fn with_clock(clock: Arc<dyn Fn() -> DateTime<Utc> + Send + Sync>) -> Self {
358 Self {
359 inner: Arc::default(),
360 clock,
361 }
362 }
363
364 /// The registry's lock. A panic while it was held poisons the mutex; the
365 /// registry's invariants do not depend on unwinding, so a poisoned lock

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected