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