Trait sentry_contrib_native::BeforeSend[][src]

pub trait BeforeSend: 'static + Send + Sync {
    fn before_send(&self, value: Value) -> Value;
}

Trait to help pass data to Options::set_before_send.

Examples

struct Filter {
    filtered: AtomicUsize,
};

impl BeforeSend for Filter {
    fn before_send(&self, value: Value) -> Value {
        self.filtered.fetch_add(1, Ordering::SeqCst);
        // do something with the value and then return it
        value
    }
}

let mut options = Options::new();
options.set_before_send(Filter {
    filtered: AtomicUsize::new(0),
});
let _shutdown = options.init()?;

Required methods

fn before_send(&self, value: Value) -> Value[src]

Before send callback.

Notes

The caller of this function will catch any unwinding panics and abort if any occured.

Examples

struct Filter {
    filtered: AtomicUsize,
};

impl BeforeSend for Filter {
    fn before_send(&self, value: Value) -> Value {
        self.filtered.fetch_add(1, Ordering::SeqCst);
        // do something with the value and then return it
        value
    }
}
Loading content...

Implementors

impl<T: Fn(Value) -> Value + 'static + Send + Sync> BeforeSend for T[src]

Loading content...