Function sentry::with_client_and_scope [] [src]

pub fn with_client_and_scope<F, R>(f: F) -> R where
    F: FnOnce(Arc<Client>, &Scope) -> R,
    R: Default

Invokes a function if the sentry client is available with client and scope.

The function is invoked with the client and current scope (read-only) and permits operations to be executed on the client. This is useful when writing integration code where potentially expensive operations should not be executed if Sentry is not configured.

The return value must be Default so that it can be created even if Sentry is not configured.