Struct actix_tools::sentry::sentry_client::Client[][src]

pub struct Client { /* fields omitted */ }

The Sentry client object.

Methods

impl Client
[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 IntoClient 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 IntoClient 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 DSN.

Creates a new sentry client for the given DSN.

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.

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

Returns the options of this client.

Returns the DSN that constructed this client.

If the client is in disabled mode this returns None.

Captures an event and sends it to sentry.

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]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl IntoClient for Client
[src]

Converts the object into a client config tuple of DSN and options. Read more

Converts the object into a client right away.

impl Debug for Client
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl Send for Client

impl Sync for Client