Public declaration syntax from forge-rs/crates/forge-telemetry/src/collector.rs Original source SHA-256: fa3e06298d43c2e95e0d099130ee6693aaaea480df6c1be3e9981ab65e6b9273 Function bodies and constant values are omitted. This is not the complete implementation. Source line 39 #[derive(Debug, Clone, Serialize, Deserialize)] pub struct CompletedSpan { /// The unique identifier for this span. pub span_id: SpanId, /// The span name (e.g., `"anvil.generate"`, `"anvil.tool.invoke"`). pub name: String, /// Key-value attributes associated with this span. pub attributes: Vec<(String, String)>, /// ISO 8601 timestamp of when the span was started. pub start_time: String, /// ISO 8601 timestamp of when the span was ended. pub end_time: String, /// The agent's OAS DID, if available. pub agent_did: Option } Source line 79 pub trait SpanCollector: Send + Sync { /// Record a completed span. /// /// # Arguments /// /// * `span` - The completed span to record. fn record_span(&self, span: CompletedSpan); /// Retrieve all recorded spans. /// /// # Returns /// /// A vector of all completed spans recorded so far. fn spans(&self) -> Vec; /// Clear all recorded spans. fn clear(&self); /// Number of recorded spans. fn len(&self) -> usize; /// Returns `true` if no spans have been recorded. fn is_empty(&self) -> bool; } Source line 127 pub struct NoopCollector; Source line 172 pub struct InMemoryCollector { } Source line 182 pub fn new() -> Self; Source line 257 pub struct InMemoryTelemetry { } Source line 274 pub fn new(agent_did: Option) -> Self; Source line 288 pub fn completed_spans(&self) -> Vec; Source line 297 pub fn events(&self) -> Vec; Source line 302 pub fn clear(&self); Source line 313 pub fn span_count(&self) -> usize; Source line 318 pub fn event_count(&self) -> usize;