adk-session 0.9.0

Session management and state persistence for Rust Agent Development Kit (ADK-Rust) agents
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Re-export Event and EventActions from adk_core for unified type
pub use adk_core::{Event, EventActions};

/// Trait for accessing events in a session.
pub trait Events: Send + Sync {
    /// Returns all events in the session.
    fn all(&self) -> Vec<Event>;
    /// Returns the number of events in the session.
    fn len(&self) -> usize;
    /// Returns the event at the given index, or `None` if out of bounds.
    fn at(&self, index: usize) -> Option<&Event>;
    /// Returns `true` if the session has no events.
    fn is_empty(&self) -> bool {
        self.len() == 0
    }
}