Struct sentry::Client

source ·
pub struct Client { /* private fields */ }
Expand description

The Sentry client object.

Implementations§

Creates a new Sentry client from a config.

Supported Configs

The following common values are supported for the client config:

  • ClientOptions: configure the client with the given client options.
  • () or empty string: Disable the client.
  • &str / String / &OsStr / String: configure the client with the given DSN.
  • Dsn / &Dsn: configure the client with a given DSN.
  • (Dsn, ClientOptions): configure the client from the given DSN and optional options.

The Default implementation of ClientOptions pulls in the DSN from the SENTRY_DSN environment variable.

Panics

The Into<ClientOptions> implementations 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.

Creates a new sentry client for the given options.

If the DSN on the options is set to None the client will be entirely disabled.

Returns the options of this client.

Returns the DSN that constructed this client.

Quick check to see if the client is enabled.

Captures an event and sends it to sentry.

Drains all pending events and shuts down the transport behind the client. After shutting down the transport is removed.

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 for as long a shutdown_timeout in the client options.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Should always be Self
The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.