pub struct SentryClient { /* private fields */ }
Expand description
Sentry client
Implementations§
Source§impl SentryClient
impl SentryClient
Sourcepub fn new(
config: SentryConfig,
request: Option<&Request>,
context: Option<&Context>,
) -> Result<SentryClient, ToucanError>
pub fn new( config: SentryConfig, request: Option<&Request>, context: Option<&Context>, ) -> Result<SentryClient, ToucanError>
Create a Sentry client. This will initialize the Sentry client with the provided configuration. The worker request and context are optional.
Sourcepub fn set_context(&self, name: &str, value: Object)
pub fn set_context(&self, name: &str, value: Object)
See Sentry’s setContext documentation
Sourcepub fn capture_message(&self, message: &str)
pub fn capture_message(&self, message: &str)
See Sentry’s captureMessage documentation
Sourcepub fn capture_exception<T: Error + ?Sized>(&self, error: &T)
pub fn capture_exception<T: Error + ?Sized>(&self, error: &T)
See Sentry’s captureException documentation
Sourcepub fn capture_js_error(&self, js_error: Error)
pub fn capture_js_error(&self, js_error: Error)
Same as capture_exception
but with a js_sys::Error
.
pub fn set_propagation_context(&self, pctx: Object)
pub fn set_request_body(&self, body: &str)
pub fn set_enabled(&self, enabled: bool)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SentryClient
impl RefUnwindSafe for SentryClient
impl !Send for SentryClient
impl !Sync for SentryClient
impl Unpin for SentryClient
impl UnwindSafe for SentryClient
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