pub trait SubmitErrorReport<'a> {
// Required methods
fn new(error: &'a ErrorReport) -> Self;
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>;
// Provided method
fn truncate_string(text: String, limit: usize) -> String { ... }
}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) -> Self
fn new(error: &'a ErrorReport) -> Self
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.
Provided Methods§
Sourcefn truncate_string(text: String, limit: usize) -> String
fn truncate_string(text: String, limit: usize) -> String
Truncate a string to the given limit, respecting character boundaries.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.