pub struct EventContext {
pub session_context: Option<String>,
pub user_message: Option<String>,
pub tool_name: Option<String>,
pub tool_output: Option<String>,
pub error: Option<String>,
pub warning: Option<String>,
pub metadata: HashMap<String, String>,
}Expand description
Context data that flows through events
Fields§
§session_context: Option<String>§user_message: Option<String>§tool_name: Option<String>§tool_output: Option<String>§error: Option<String>§warning: Option<String>§metadata: HashMap<String, String>Implementations§
Source§impl EventContext
impl EventContext
pub fn new() -> Self
pub fn with_session_context(self, ctx: String) -> Self
pub fn with_user_message(self, msg: String) -> Self
pub fn with_tool_name(self, name: String) -> Self
pub fn with_tool_output(self, output: String) -> Self
pub fn with_error(self, error: String) -> Self
pub fn with_metadata(self, key: String, value: String) -> Self
Trait Implementations§
Source§impl Clone for EventContext
impl Clone for EventContext
Source§fn clone(&self) -> EventContext
fn clone(&self) -> EventContext
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 Debug for EventContext
impl Debug for EventContext
Auto Trait Implementations§
impl Freeze for EventContext
impl RefUnwindSafe for EventContext
impl Send for EventContext
impl Sync for EventContext
impl Unpin for EventContext
impl UnsafeUnpin for EventContext
impl UnwindSafe for EventContext
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