1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
use crate::api;
#[cfg(feature = "serialize")]
use serde::{Deserialize, Serialize};
#[cfg_attr(feature = "serialize", derive(Deserialize, Serialize))]
#[derive(Clone, Debug, PartialEq)]
pub struct Link {
span_context: api::SpanContext,
attributes: Vec<api::KeyValue>,
}
impl Link {
pub fn new(span_context: api::SpanContext, attributes: Vec<api::KeyValue>) -> Self {
Link {
span_context,
attributes,
}
}
pub fn span_context(&self) -> &api::SpanContext {
&self.span_context
}
pub fn attributes(&self) -> &Vec<api::KeyValue> {
&self.attributes
}
}