vv-agent 0.8.0

VectorVein agent runtime, SDK, CLI, tools, and workspace backends
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use super::{CreatedAtWire, EventId, RunEvent};

impl RunEvent {
    pub(crate) fn with_observed_identity(
        mut self,
        event_id: impl Into<String>,
        created_at: f64,
    ) -> Result<Self, String> {
        if !created_at.is_finite() || created_at < 0.0 {
            return Err("created_at must be a finite non-negative number".to_string());
        }
        self.event_id = EventId::stable(event_id)?;
        self.created_at = created_at;
        self.created_at_wire = CreatedAtWire::default();
        Ok(self)
    }
}