pub trait ErrorReporter: Send + Sync {
// Required method
fn capture(&self, error: &Error) -> Result<()>;
// Provided method
fn capture_message(
&self,
message: impl Into<Cow<'static, str>>,
) -> Result<()>
where Self: Sized { ... }
}Expand description
Reports non-fatal errors to an observability backend.
Required Methods§
Provided Methods§
Sourcefn capture_message(&self, message: impl Into<Cow<'static, str>>) -> Result<()>where
Self: Sized,
fn capture_message(&self, message: impl Into<Cow<'static, str>>) -> Result<()>where
Self: Sized,
Convenience helper to capture a simple message.
where Self: Sized keeps the trait object-safe so consumers can erase
a concrete reporter into &dyn ErrorReporter at their API boundary;
the helper stays available on every concrete implementation.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".