SubmitMethod

Trait SubmitMethod 

Source
pub trait SubmitMethod: Send + Sync {
    // Required method
    fn submit(&self, info: &DebugInfo<'_>) -> bool;

    // Provided methods
    fn submission_succeeded(&self, info: &DebugInfo<'_>) { ... }
    fn submission_failed(&self, info: &DebugInfo<'_>) { ... }
}
Expand description

The trait that needs to be implemented for using the watch() function.

§Example mockup

pub struct MockType {}

impl SubmitMethod for MockType {
    fn submit(&self, info: &DebugInfo) -> bool {
        false
    }
}

Required Methods§

Source

fn submit(&self, info: &DebugInfo<'_>) -> bool

The submit() function is used for submitting information about a crash of an exectuable The return value of type ‘bool’ should indicate wether the DebugInfo is submitted successfully.

Provided Methods§

Source

fn submission_succeeded(&self, info: &DebugInfo<'_>)

This function will be called by watch() if the submit() function returns ‘true’.

§Default implementation
fn submission_succeeded(&self, info: &DebugInfo) {
    println!("Thank you for your submission. We will investigate what happened A.S.A.P.");
}
Source

fn submission_failed(&self, info: &DebugInfo<'_>)

This function will be called by watch() if the submit() function returns ‘false’.

§Default implementation
fn submission_failed(&self, info &DebugInfo) {
    println!("Something went wrong. Our apologies for the inconvenience. This information could not be sent:\n{}", info);
}

Implementors§