We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c75413c commit c4f59daCopy full SHA for c4f59da
opentelemetry-sdk/CHANGELOG.md
@@ -2,6 +2,9 @@
2
3
## vNext
4
5
+### Added
6
+- Added `Resource::get_ref(&self, key: &Key) -> Option<&Value>` to allow retrieving a reference to a resource value without cloning.
7
+
8
## 0.31.0
9
10
Released 2025-Sep-25
opentelemetry-sdk/src/resource/mod.rs
@@ -228,6 +228,11 @@ impl Resource {
228
pub fn get(&self, key: &Key) -> Option<Value> {
229
self.inner.attrs.get(key).cloned()
230
}
231
232
+ /// Returns a reference to the value for the resource associated with the given key without cloning.
233
+ pub fn get_ref(&self, key: &Key) -> Option<&Value> {
234
+ self.inner.attrs.get(key)
235
+ }
236
237
238
/// An iterator over the entries of a `Resource`.
0 commit comments