Skip to content

Commit fd92a32

Browse files
Allow retrieving user of scope (#715)
1 parent a2bdeca commit fd92a32

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

sentry-core/src/scope/real.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,11 @@ impl Scope {
197197
self.user = user.map(Arc::new);
198198
}
199199

200+
/// Retrieves the user of the current scope.
201+
pub fn user(&self) -> Option<&User> {
202+
self.user.as_deref()
203+
}
204+
200205
/// Sets a tag to a specific value.
201206
pub fn set_tag<V: ToString>(&mut self, key: &str, value: V) {
202207
Arc::make_mut(&mut self.tags).insert(key.to_string(), value.to_string());

0 commit comments

Comments
 (0)