pub struct CrashpadClient { /* private fields */ }
Expand description
A Crashpad client that can be used to capture and report crashes.
Implementations§
Source§impl CrashpadClient
impl CrashpadClient
Sourcepub fn start_with_config(
&self,
config: &CrashpadConfig,
annotations: &HashMap<String, String>,
) -> Result<()>
pub fn start_with_config( &self, config: &CrashpadConfig, annotations: &HashMap<String, String>, ) -> Result<()>
Starts the Crashpad handler with a configuration.
Sourcepub fn start_handler(
&self,
handler_path: &Path,
database_path: &Path,
metrics_path: &Path,
url: Option<&str>,
annotations: &HashMap<String, String>,
) -> Result<()>
pub fn start_handler( &self, handler_path: &Path, database_path: &Path, metrics_path: &Path, url: Option<&str>, annotations: &HashMap<String, String>, ) -> Result<()>
Starts the Crashpad handler process.
§Arguments
handler_path
- Path to the Crashpad handler executabledatabase_path
- Path where crash dumps will be storedmetrics_path
- Path for metrics data (can be empty)url
- URL to upload crash reports to (can be None for local-only)annotations
- Key-value pairs to include with crash reports
Sourcepub fn dump_without_crash(&self)
pub fn dump_without_crash(&self)
Capture a crash dump without actually crashing the process.
This is useful for diagnostic purposes when you want to capture the current state of the application without terminating it. The dump will be processed and uploaded (if configured) just like a regular crash dump.
§Example
// Capture diagnostic information when an error occurs
let some_error_condition = true; // Your actual error condition here
if some_error_condition {
client.dump_without_crash();
// Continue running - the process doesn't terminate
}
§Note
A handler must have been installed before calling this method. The captured context will be from the point where this function is called.
Trait Implementations§
Source§impl Drop for CrashpadClient
impl Drop for CrashpadClient
impl Send for CrashpadClient
impl Sync for CrashpadClient
Auto Trait Implementations§
impl Freeze for CrashpadClient
impl RefUnwindSafe for CrashpadClient
impl Unpin for CrashpadClient
impl UnwindSafe for CrashpadClient
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