use std::ops::Deref;
use opentelemetry::trace::Event;
#[derive(Clone, Debug, Default, PartialEq)]
#[non_exhaustive]
pub struct SpanEvents {
pub events: Vec<Event>,
pub dropped_count: u32,
}
impl Deref for SpanEvents {
type Target = [Event];
fn deref(&self) -> &Self::Target {
&self.events
}
}
impl IntoIterator for SpanEvents {
type Item = Event;
type IntoIter = std::vec::IntoIter<Self::Item>;
fn into_iter(self) -> Self::IntoIter {
self.events.into_iter()
}
}
impl SpanEvents {
pub(crate) fn add_event(&mut self, event: Event) {
self.events.push(event);
}
}