You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2022/07/17 12:45:18 UTC

[GitHub] [skywalking-rust] wu-sheng commented on a diff in pull request #29: Add context capture and continued methods.

wu-sheng commented on code in PR #29:
URL: https://github.com/apache/skywalking-rust/pull/29#discussion_r922828189


##########
src/context/trace_context.rs:
##########
@@ -119,8 +118,16 @@ impl TracingContext {
     }
 
     #[inline]
-    pub fn trace_id(&self) -> &str {
-        &self.inner.trace_id
+    pub fn trace_id(&self) -> String {
+        self.with_trace_id(ToString::to_string)
+    }
+
+    fn with_trace_id<T>(&self, f: impl FnOnce(&String) -> T) -> T {
+        f(&*self.inner.trace_id.try_read().expect(LOCK_MSG))
+    }

Review Comment:
   Are you going to expose trace ID to users for an override?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org