pub struct CustomEvent { /* private fields */ }Expand description
The data of a custom event. Every field is optional; each setter consumes the event and returns it changed.
use std::time::Duration;
use agentcat_sdk::CustomEvent;
let event = CustomEvent::new()
.session_id("ses_1")
.message("cache warmed")
.duration(Duration::from_millis(40));Implementations§
Source§impl CustomEvent
impl CustomEvent
Sourcepub fn session_id(self, id: impl Into<String>) -> Self
pub fn session_id(self, id: impl Into<String>) -> Self
The session the event belongs to.
Sourcepub fn resource_name(self, name: impl Into<String>) -> Self
pub fn resource_name(self, name: impl Into<String>) -> Self
The name of the resource the event is about.
Sourcepub fn parameters(self, parameters: Value) -> Self
pub fn parameters(self, parameters: Value) -> Self
The parameters of what happened.
Tags on the event.
Sourcepub fn properties(self, properties: Map<String, Value>) -> Self
pub fn properties(self, properties: Map<String, Value>) -> Self
Properties on the event.
Trait Implementations§
Source§impl Clone for CustomEvent
impl Clone for CustomEvent
Source§impl Debug for CustomEvent
impl Debug for CustomEvent
Auto Trait Implementations§
impl Freeze for CustomEvent
impl RefUnwindSafe for CustomEvent
impl Send for CustomEvent
impl Sync for CustomEvent
impl Unpin for CustomEvent
impl UnsafeUnpin for CustomEvent
impl UnwindSafe for CustomEvent
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