Function sentry::push_scope [] [src]

pub fn push_scope() -> ScopeGuard

Pushes a new scope on the stack.

The currently bound client is propagated to the new scope and already existing data on the scope is inherited. Modifications done to the inner scope however are isolated from the outer scope.

This returns a guard. When the guard is collected the scope is popped again.

Example

{
    let _guard = sentry::push_scope();
    sentry::configure_scope(|scope| {
        scope.set_tag("some_tag", "some_value");
    });
    // until the end of the block the scope is changed.
}