Skip to main content

Clock

Trait Clock 

Source
pub trait Clock:
    Debug
    + Send
    + Sync {
    // Required method
    fn now(&self) -> DateTime<Utc>;
}
Expand description

Core traits and types.

Always available regardless of feature flags. Includes:

  • Agent - The fundamental trait for all agents
  • Tool / Toolset - For extending agents with capabilities
  • Session / State - For managing conversation context
  • Event - For streaming agent responses
  • AdkError / Result - Unified error handling Source of the current UTC time.

§Example

use adk_core::{Clock, SystemClock};

let before = chrono::Utc::now();
assert!(SystemClock.now() >= before);

Required Methods§

Source

fn now(&self) -> DateTime<Utc>

Returns the current time.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§