Struct sentry::ClientInitGuard
source · [−]pub struct ClientInitGuard(_);
Expand description
Helper struct that is returned from init
.
When this is dropped events are drained with the configured shutdown_timeout
.
Implementations
Quick check if the client is enabled.
Methods from Deref<Target = Client>
Returns the options of this client.
Quick check to see if the client is enabled.
The Client is enabled if it has a valid DSN and Transport configured.
Examples
use std::sync::Arc;
let client = sentry::Client::from(sentry::ClientOptions::default());
assert!(!client.is_enabled());
let dsn = "https://public@example.com/1";
let transport = sentry::test::TestTransport::new();
let client = sentry::Client::from((
dsn,
sentry::ClientOptions {
transport: Some(Arc::new(transport)),
..Default::default()
},
));
assert!(client.is_enabled());
Captures an event and sends it to sentry.
Sends the specified Envelope
to sentry.
Drains all pending events without shutting down.
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.
Returns a random boolean with a probability defined
by the ClientOptions
’s traces_sample_rate
Trait Implementations
Auto Trait Implementations
impl RefUnwindSafe for ClientInitGuard
impl Send for ClientInitGuard
impl Sync for ClientInitGuard
impl Unpin for ClientInitGuard
impl UnwindSafe for ClientInitGuard
Blanket Implementations
Mutably borrows from an owned value. Read more
Instruments this type with the provided Span
, returning an
Instrumented
wrapper. Read more
pub fn vzip(self) -> V
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more