pub struct OcsfEventBuilder { /* private fields */ }Expand description
Builder for OcsfEvent enforcing invariants at construction.
Implementations§
Source§impl OcsfEventBuilder
impl OcsfEventBuilder
Sourcepub fn new(
class: EventClass,
session_uid: impl Into<String>,
ai_agent: AgentIdentity,
seq: u64,
) -> Self
pub fn new( class: EventClass, session_uid: impl Into<String>, ai_agent: AgentIdentity, seq: u64, ) -> Self
Start building an event of class for session_uid with sequence seq.
Sourcepub fn stop_reason(self, r: StopReason) -> Self
pub fn stop_reason(self, r: StopReason) -> Self
Attach a stop reason.
Sourcepub fn stop_reason_native(
self,
reason: StopReason,
native: impl Into<String>,
) -> Self
pub fn stop_reason_native( self, reason: StopReason, native: impl Into<String>, ) -> Self
Attach a normalized reason and the provider’s source-native value.
Sourcepub fn metrics(self, m: EventMetrics) -> Self
pub fn metrics(self, m: EventMetrics) -> Self
Attach token metrics.
Sourcepub fn inventory(
self,
current: Fingerprint,
previous: Option<Fingerprint>,
) -> Self
pub fn inventory( self, current: Fingerprint, previous: Option<Fingerprint>, ) -> Self
Attach inventory fingerprints (roadmap feature).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for OcsfEventBuilder
impl RefUnwindSafe for OcsfEventBuilder
impl Send for OcsfEventBuilder
impl Sync for OcsfEventBuilder
impl Unpin for OcsfEventBuilder
impl UnsafeUnpin for OcsfEventBuilder
impl UnwindSafe for OcsfEventBuilder
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