pub struct Events<'a> { /* private fields */ }managed-agents-preview only.Expand description
Namespace handle for session-events operations.
Obtained via
Sessions::events.
Implementations§
Source§impl Events<'_>
impl Events<'_>
Sourcepub async fn send(&self, events: &[OutgoingUserEvent]) -> Result<()>
pub async fn send(&self, events: &[OutgoingUserEvent]) -> Result<()>
POST /v1/sessions/{id}/events. The server returns 204 on
success; this method returns ().
Sourcepub async fn list(&self) -> Result<Paginated<SessionEvent>>
pub async fn list(&self) -> Result<Paginated<SessionEvent>>
GET /v1/sessions/{id}/events. Returns the full event history
for the session as a Paginated<SessionEvent>.
Sourcepub async fn stream(&self) -> Result<EventStream>
Available on crate feature streaming only.
pub async fn stream(&self) -> Result<EventStream>
streaming only.GET /v1/sessions/{id}/stream. Returns an EventStream
yielding SessionEvents as they’re emitted server-side.
Open the stream before sending events to avoid a race: only
events emitted after the stream is opened are delivered. To
reconnect to an existing session without missing events, open
the stream first, then list the history to seed
a set of seen event IDs and skip duplicates from the live tail.
Streaming requests are not retried – a mid-stream retry would silently drop events.
Auto Trait Implementations§
impl<'a> Freeze for Events<'a>
impl<'a> !RefUnwindSafe for Events<'a>
impl<'a> Send for Events<'a>
impl<'a> Sync for Events<'a>
impl<'a> Unpin for Events<'a>
impl<'a> UnsafeUnpin for Events<'a>
impl<'a> !UnwindSafe for Events<'a>
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
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>
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>
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 more