Function sentry::scope_handle [] [src]

pub fn scope_handle() -> ScopeHandle

Returns the handle to the current scope.

This can be used to propagate a scope to another thread easily. The parent thread retrieves a handle and the child thread binds it. A handle can be cloned so that it can be used in multiple threads.

Example

use std::thread;

sentry::configure_scope(|scope| {
    scope.set_tag("task", "task-name");
});
let handle = sentry::scope_handle();
thread::spawn(move || {
    handle.bind();
    // ...
});