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§
Provided Methods§
Sourcefn submission_succeeded(&self, info: &DebugInfo<'_>)
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.");
}Sourcefn submission_failed(&self, info: &DebugInfo<'_>)
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);
}