pub trait ClockSource: Send + Sync {
// Required method
fn now(&self) -> SystemTime;
}Expand description
A source of the current wall-clock time.
Implementors must guarantee now() is cheap (no I/O, no blocking) since it is called on
hot paths (tool execution, per-turn system-prompt assembly). Callers may assume the
returned SystemTime reflects UTC “now” for SystemClock, or a fixed, caller-chosen
instant for FixedClock.
Required Methods§
Sourcefn now(&self) -> SystemTime
fn now(&self) -> SystemTime
Returns the current time.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".