pub trait SubmitErrorReport<'a> {
// Required methods
fn new(error: &'a ErrorReport) -> Self
where Self: Sized;
fn get_error_report(&self) -> &ErrorReport;
fn get_title(&self) -> String;
fn create_message(&self) -> Result<String, ErrorReport>;
fn create_bug_report(&self) -> Result<String, ErrorReport>;
fn create_submit_url(&self) -> Result<Url, ErrorReport>;
fn create_submit_url_limited(
&self,
max_length: usize,
) -> Result<Url, ErrorReport>;
fn check_existing_reports(&self) -> Result<Url, ErrorReport>;
fn validate_settings(&self) -> Result<(), ErrorReport>;
// Provided method
fn truncate_string(text: String, limit: usize) -> String
where Self: Sized { ... }
}Expand description
Trait for converting an ErrorReport into a submittable issue report.
Implement this trait to add support for a new issue tracking platform.
See GitLabErrorReport for the built-in GitLab implementation.
Required Methods§
Sourcefn new(error: &'a ErrorReport) -> Selfwhere
Self: Sized,
fn new(error: &'a ErrorReport) -> Selfwhere
Self: Sized,
Create a new report wrapper from an error report reference.
Sourcefn get_error_report(&self) -> &ErrorReport
fn get_error_report(&self) -> &ErrorReport
Return the ErrorReport containing the error stack.
Sourcefn create_message(&self) -> Result<String, ErrorReport>
fn create_message(&self) -> Result<String, ErrorReport>
Create the full user-facing error message with report instructions.
Sourcefn create_bug_report(&self) -> Result<String, ErrorReport>
fn create_bug_report(&self) -> Result<String, ErrorReport>
Create the bug report body text (same content as the URL submission).
Sourcefn create_submit_url(&self) -> Result<Url, ErrorReport>
fn create_submit_url(&self) -> Result<Url, ErrorReport>
Create a URL that opens a pre-filled issue on the platform.
Sourcefn create_submit_url_limited(
&self,
max_length: usize,
) -> Result<Url, ErrorReport>
fn create_submit_url_limited( &self, max_length: usize, ) -> Result<Url, ErrorReport>
Create a pre-filled issue URL, progressively removing detail to stay under max_length.
Sourcefn check_existing_reports(&self) -> Result<Url, ErrorReport>
fn check_existing_reports(&self) -> Result<Url, ErrorReport>
Create a URL to search for existing reports with the same title.
Sourcefn validate_settings(&self) -> Result<(), ErrorReport>
fn validate_settings(&self) -> Result<(), ErrorReport>
Validate that required global settings have been configured.
Called by setup_panic! in debug builds to
catch missing configuration early.