@@ -72,7 +72,7 @@ use opentelemetry::{Key, KeyValue, Value};
72
72
/// This must implement [Hash], [PartialEq], and [Eq] so it may be used as
73
73
/// HashMap keys and other de-duplication methods.
74
74
#[ derive( Clone , Default , Debug , PartialEq , Eq ) ]
75
- pub struct AttributeSet ( Vec < KeyValue > , u64 ) ;
75
+ pub ( crate ) struct AttributeSet ( Vec < KeyValue > , u64 ) ;
76
76
77
77
impl From < & [ KeyValue ] > for AttributeSet {
78
78
fn from ( values : & [ KeyValue ] ) -> Self {
@@ -109,34 +109,13 @@ impl AttributeSet {
109
109
AttributeSet ( values, hash)
110
110
}
111
111
112
- /// Returns `true` if the set contains no elements.
113
- pub fn is_empty ( & self ) -> bool {
114
- self . 0 . is_empty ( )
115
- }
116
-
117
- /// Retains only the attributes specified by the predicate.
118
- pub fn retain < F > ( & mut self , f : F )
119
- where
120
- F : Fn ( & KeyValue ) -> bool ,
121
- {
122
- self . 0 . retain ( |kv| f ( kv) ) ;
123
-
124
- // Recalculate the hash as elements are changed.
125
- self . 1 = calculate_hash ( & self . 0 ) ;
126
- }
127
-
128
112
/// Iterate over key value pairs in the set
129
- pub fn iter ( & self ) -> impl Iterator < Item = ( & Key , & Value ) > {
113
+ pub ( crate ) fn iter ( & self ) -> impl Iterator < Item = ( & Key , & Value ) > {
130
114
self . 0 . iter ( ) . map ( |kv| ( & kv. key , & kv. value ) )
131
115
}
132
116
133
- /// Returns a slice of the key value pairs in the set
134
- pub fn as_slice ( & self ) -> & [ KeyValue ] {
135
- & self . 0
136
- }
137
-
138
117
/// Returns the underlying Vec of KeyValue pairs
139
- pub fn into_vec ( self ) -> Vec < KeyValue > {
118
+ pub ( crate ) fn into_vec ( self ) -> Vec < KeyValue > {
140
119
self . 0
141
120
}
142
121
}
0 commit comments