pub struct EventHistory { /* private fields */ }Expand description
Read-only message/history projection rebuilt from canonical events.
Implementations§
Source§impl EventHistory
impl EventHistory
Sourcepub fn new(reader: Arc<dyn EventReader>) -> EventHistory
pub fn new(reader: Arc<dyn EventReader>) -> EventHistory
Project messages from a bounded canonical event reader.
Sourcepub fn event_reader(&self) -> Arc<dyn EventReader> ⓘ
pub fn event_reader(&self) -> Arc<dyn EventReader> ⓘ
Underlying canonical reader.
Sourcepub async fn has_history(
&self,
session_id: TypedId<SessionIdMarker>,
) -> Result<bool, EventLogError>
pub async fn has_history( &self, session_id: TypedId<SessionIdMarker>, ) -> Result<bool, EventLogError>
Whether the canonical log contains any event for this session id.
This reports history presence only. It is deliberately not a session identity/catalog check: a valid session can have no events, and retained events can outlive the session record that originally produced them.
Sourcepub async fn read_page(
&self,
request: EventHistoryReadRequest,
) -> Result<EventHistoryPage, EventLogError>
pub async fn read_page( &self, request: EventHistoryReadRequest, ) -> Result<EventHistoryPage, EventLogError>
Read one bounded projected-message page without collecting the session.
Raw event reads stay bounded by the remaining message slots, lifecycle
envelopes are skipped, the first event snapshot is retained across all
internal reads, and no more than MAX_EVENT_HISTORY_REPLAY envelopes
are examined.
Trait Implementations§
Source§impl Clone for EventHistory
impl Clone for EventHistory
Source§fn clone(&self) -> EventHistory
fn clone(&self) -> EventHistory
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl MessageRetriever for EventHistory
impl MessageRetriever for EventHistory
Source§fn get<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
message_id: TypedId<MessageIdMarker>,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
fn get<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
message_id: TypedId<MessageIdMarker>,
) -> Pin<Box<dyn Future<Output = Result<Option<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
Get a specific message by ID
Source§fn load<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
fn load<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
Load all messages for a session
Source§fn load_filtered<'life0, 'async_trait>(
&'life0 self,
query: MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
fn load_filtered<'life0, 'async_trait>(
&'life0 self,
query: MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
Load messages with filters and injections applied. Read more
fn load_filtered_history<'life0, 'async_trait>(
&'life0 self,
query: MessageQuery,
) -> Pin<Box<dyn Future<Output = Result<MessageHistory, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
Source§fn load_page<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
fn load_page<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
offset: usize,
limit: usize,
) -> Pin<Box<dyn Future<Output = Result<Vec<Message>, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
Load messages with pagination
Source§fn count<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
) -> Pin<Box<dyn Future<Output = Result<usize, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
fn count<'life0, 'async_trait>(
&'life0 self,
session_id: TypedId<SessionIdMarker>,
) -> Pin<Box<dyn Future<Output = Result<usize, AgentLoopError>> + Send + 'async_trait>>where
'life0: 'async_trait,
EventHistory: 'async_trait,
Count messages in a session
Auto Trait Implementations§
impl !RefUnwindSafe for EventHistory
impl !UnwindSafe for EventHistory
impl Freeze for EventHistory
impl Send for EventHistory
impl Sync for EventHistory
impl Unpin for EventHistory
impl UnsafeUnpin for EventHistory
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FutureExt for T
impl<T> FutureExt for T
Source§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
Source§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T in a tonic::Request