Struct sentry_contrib_native::Shutdown[][src]

pub struct Shutdown;

Automatically shuts down the Sentry client on drop.

Examples

fn main() -> Result<()> {
    let options = Options::new();
    let _shutdown: Shutdown = options.init()?;

    // ...
    // your application code
    // ...

    Ok(())
    // Sentry client will automatically shutdown because `Shutdown` is leaving context
}

Implementations

impl Shutdown[src]

pub fn forget(self)[src]

Disable automatic shutdown. Call shutdown manually to force transports to flush out before the program exits.

Examples

fn main() -> Result<()> {
    sentry_init()?;

    // ...
    // your application code
    // ...

    // call shutdown manually to make sure transports flush out
    shutdown();
    Ok(())
}

fn sentry_init() -> Result<()> {
    let options = Options::new();
    // call forget because we are leaving the context and we don't want to shut down the Sentry client yet
    options.init()?.forget();
    Ok(())
}

pub fn shutdown(self)[src]

Manually shutdown.

Examples

fn main() -> Result<()> {
    let options = Options::new();
    let shutdown = options.init()?;

    // ...
    // your application code
    // ...

    // call shutdown manually to make sure transports flush out
    shutdown.shutdown();
    Ok(())
}

Trait Implementations

impl Clone for Shutdown[src]

impl Debug for Shutdown[src]

impl Drop for Shutdown[src]

impl Eq for Shutdown[src]

impl Hash for Shutdown[src]

impl Ord for Shutdown[src]

impl PartialEq<Shutdown> for Shutdown[src]

impl PartialOrd<Shutdown> for Shutdown[src]

impl StructuralEq for Shutdown[src]

impl StructuralPartialEq for Shutdown[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.