Struct sentry::Client [] [src]

pub struct Client { /* fields omitted */ }

The Sentry client object.

Shim Behavior

This type is technically available in Shim mode but cannot be constructed. It's passed to some callbacks but those callbacks will never be executed if the shim is not configured so a lot of the implementations are irrelevant as the code is effectively dead.

To see what types are available in shim only mode refer to the shim client docs.

Methods

impl Client
[src]

[src]

Creates a new Sentry client from a config helper.

As the config helper can also disable the client this method might return None instead. This is what sentry::init uses internally before binding the client.

The client config can be of one of many formats as implemented by the IntoClientConfig trait. The most common form is to just supply a string with the DSN.

Supported Configs

The following common values are supported for the client config:

  • (): pick up the default config from the environment only
  • &str / String / &OsStr / String: configure the client with the given DSN
  • Dsn / &Dsn: configure the client with a given DSN
  • (C, options): configure the client from the given DSN and optional options.

The tuple form lets you do things like (Dsn, ClientOptions) for instance.

Panics

The IntoClientConfig can panic for the forms where a DSN needs to be parsed. If you want to handle invalid DSNs you need to parse them manually by calling parse on it and handle the error.

[src]

Creates a new sentry client for the given DSN.

[src]

Creates a new sentry client for the given DSN.

[src]

Creates a new client that does not send anything.

This is useful when general sentry handling is wanted but a client cannot be bound yet as the DSN might not be available yet. In that case a disabled client can be bound and later replaced by another one.

A disabled client can be detected by inspecting the DSN. If the DSN is None then the client is disabled.

[src]

Creates a new client that does not send anything with custom options.

[src]

Returns the options of this client.

[src]

Returns the DSN that constructed this client.

If the client is in disabled mode this returns None.

[src]

Captures an event and sends it to sentry.

[src]

Drains all pending events up to the current time.

This returns true if the queue was successfully drained in the given time or false if not (for instance because of a timeout). If no timeout is provided the client will wait forever.

Trait Implementations

impl Clone for Client
[src]

[src]

Returns a copy of the value. Read more

1.0.0
[src]

Performs copy-assignment from source. Read more

impl Debug for Client
[src]

[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Client

impl Sync for Client