Struct rocket_sentry_logger::Guard [−][src]
Helper struct that is returned from init
.
When this is dropped events are drained with the configured shutdown_timeout
.
Implementations
impl ClientInitGuard
[src]
pub fn is_enabled(&self) -> bool
[src]
Quick check if the client is enabled.
Methods from Deref<Target = Client>
pub fn options(&self) -> &ClientOptions
Returns the options of this client.
pub fn dsn(&self) -> Option<&Dsn>
Returns the DSN that constructed this client.
pub fn is_enabled(&self) -> bool
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());
pub fn capture_event(
&self,
event: Event<'static>,
scope: Option<&Scope>
) -> Uuid
&self,
event: Event<'static>,
scope: Option<&Scope>
) -> Uuid
Captures an event and sends it to sentry.
pub fn send_envelope(&self, envelope: Envelope)
Sends the specified [Envelope
] to sentry.
pub fn close(&self, timeout: Option<Duration>) -> bool
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
impl Deref for ClientInitGuard
[src]
type Target = Client
The resulting type after dereferencing.
pub fn deref(&self) -> &<ClientInitGuard as Deref>::Target
[src]
impl Drop for ClientInitGuard
[src]
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
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T, I> AsResult<T, I> for T where
I: Input,
I: Input,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoCollection<T> for T
pub fn into_collection<A>(self) -> SmallVec<A> where
A: Array<Item = T>,
A: Array<Item = T>,
pub fn mapped<U, F, A>(self, f: F) -> SmallVec<A> where
A: Array<Item = U>,
F: FnMut(T) -> U,
A: Array<Item = U>,
F: FnMut(T) -> U,
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Typeable for T where
T: Any,
T: Any,
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,