opentelemetry_sdk/trace/
links.rs
1use std::ops::Deref;
4
5use opentelemetry::trace::Link;
6#[derive(Clone, Debug, Default, PartialEq)]
8#[non_exhaustive]
9pub struct SpanLinks {
10 pub links: Vec<Link>,
12 pub dropped_count: u32,
14}
15
16impl Deref for SpanLinks {
17 type Target = [Link];
18
19 fn deref(&self) -> &Self::Target {
20 &self.links
21 }
22}
23
24impl IntoIterator for SpanLinks {
25 type Item = Link;
26 type IntoIter = std::vec::IntoIter<Self::Item>;
27
28 fn into_iter(self) -> Self::IntoIter {
29 self.links.into_iter()
30 }
31}
32
33impl SpanLinks {
34 pub(crate) fn add_link(&mut self, link: Link) {
35 self.links.push(link);
36 }
37}