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

Function observed_now

libatomic/src/daemon/services_provenance.rs:158–163  ·  view source on GitHub ↗

The caller-supplied observation time. The server NEVER substitutes its own clock for observation times — `now` rides the request exactly like the legacy protocol's explicit `now` field.

(meta: &Option<RequestMeta>)

Source from the content-addressed store, hash-verified

156/// own clock for observation times — `now` rides the request exactly like
157/// the legacy protocol's explicit `now` field.
158fn observed_now(meta: &Option<RequestMeta>) -> i64 {
159 meta.as_ref()
160 .and_then(|meta| meta.observed_at.as_ref())
161 .map(|stamp| stamp.seconds)
162 .unwrap_or(0)
163}
164
165fn timestamp(seconds: i64) -> prost_types::Timestamp {
166 prost_types::Timestamp { seconds, nanos: 0 }

Callers 5

reserve_turn_implFunction · 0.85
append_envelopes_implFunction · 0.85
prepare_checkpoint_implFunction · 0.85
update_turn_implFunction · 0.85

Calls 1

as_refMethod · 0.80

Tested by

no test coverage detected