pub struct CaptureExceptionOptions { /* private fields */ }Expand description
Optional context for capture_exception_with: person identity, custom
properties, groups, and exception fingerprint/level.
All fields are optional. An empty options set (new() / Default)
captures the exception personlessly with no extra context.
§Examples
use posthog_rs::CaptureExceptionOptions;
let options = CaptureExceptionOptions::new()
.distinct_id("user-123")
.property("route", "/checkout")?
.group("company", "acme")
.fingerprint("checkout-error")
.level("warning");Implementations§
Source§impl CaptureExceptionOptions
impl CaptureExceptionOptions
Sourcepub fn distinct_id<S: Into<String>>(self, distinct_id: S) -> Self
pub fn distinct_id<S: Into<String>>(self, distinct_id: S) -> Self
Associate the exception with a person.
Sourcepub fn property<K: Into<String>, V: Serialize>(
self,
key: K,
value: V,
) -> Result<Self, Error>
pub fn property<K: Into<String>, V: Serialize>( self, key: K, value: V, ) -> Result<Self, Error>
Add a custom property to the exception event.
Sourcepub fn group<N: Into<String>, I: Into<String>>(
self,
group_name: N,
group_id: I,
) -> Self
pub fn group<N: Into<String>, I: Into<String>>( self, group_name: N, group_id: I, ) -> Self
Capture the exception as a group event.
Sourcepub fn fingerprint<S: Into<String>>(self, fingerprint: S) -> Self
pub fn fingerprint<S: Into<String>>(self, fingerprint: S) -> Self
Set a custom exception fingerprint.
Trait Implementations§
Source§impl Clone for CaptureExceptionOptions
impl Clone for CaptureExceptionOptions
Source§fn clone(&self) -> CaptureExceptionOptions
fn clone(&self) -> CaptureExceptionOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for CaptureExceptionOptions
impl Debug for CaptureExceptionOptions
Source§impl Default for CaptureExceptionOptions
impl Default for CaptureExceptionOptions
Source§fn default() -> CaptureExceptionOptions
fn default() -> CaptureExceptionOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for CaptureExceptionOptions
impl RefUnwindSafe for CaptureExceptionOptions
impl Send for CaptureExceptionOptions
impl Sync for CaptureExceptionOptions
impl Unpin for CaptureExceptionOptions
impl UnsafeUnpin for CaptureExceptionOptions
impl UnwindSafe for CaptureExceptionOptions
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more