[−][src]Trait sentry_contrib_native::BeforeSend
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
Before send callback.
Notes
The caller of this function will catch any unwinding panics and
abort
if any occured.
Panics
Panics if any String
in the returning Value
contains a null
byte.
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 } }