Skip to main content

adk_session/
event.rs

1// Re-export Event and EventActions from adk_core for unified type
2pub use adk_core::{Event, EventActions};
3
4/// Trait for accessing events in a session.
5pub trait Events: Send + Sync {
6    /// Returns all events in the session.
7    fn all(&self) -> Vec<Event>;
8    /// Returns the number of events in the session.
9    fn len(&self) -> usize;
10    /// Returns the event at the given index, or `None` if out of bounds.
11    fn at(&self, index: usize) -> Option<&Event>;
12    /// Returns `true` if the session has no events.
13    fn is_empty(&self) -> bool {
14        self.len() == 0
15    }
16}