pub struct GitLabErrorReport<'a> {
pub error_report: &'a ErrorReport,
}Expand description
GitLab implementation of SubmitErrorReport.
Generates pre-filled GitLab issue URLs from error reports. Before use,
call setup_global_config once
at application startup.
§Example
use charon_error::prelude::*;
use charon_error::prelude::gitlab_er::*;
GitLabErrorReport::setup_global_config(GitLabERGlobalSettings {
domain: "gitlab.com".to_owned(),
project_path: "my-group/my-project".to_owned(),
..Default::default()
}).unwrap_error();Fields§
§error_report: &'a ErrorReportReference to the error report being submitted.
Implementations§
Source§impl<'a> GitLabErrorReport<'a>
impl<'a> GitLabErrorReport<'a>
Sourcepub fn setup_global_config(
config: GitLabERGlobalSettings,
) -> Result<(), ErrorReport>
pub fn setup_global_config( config: GitLabERGlobalSettings, ) -> Result<(), ErrorReport>
Initialize the global GitLab configuration. Must be called once at startup.
Returns an error if called more than once.
Sourcepub fn get_global_config() -> Result<RwLockReadGuard<'static, GitLabERGlobalSettings>, ErrorReport>
pub fn get_global_config() -> Result<RwLockReadGuard<'static, GitLabERGlobalSettings>, ErrorReport>
Read the global GitLab configuration. Returns an error if not yet set.
Trait Implementations§
Source§impl<'a> Clone for GitLabErrorReport<'a>
impl<'a> Clone for GitLabErrorReport<'a>
Source§fn clone(&self) -> GitLabErrorReport<'a>
fn clone(&self) -> GitLabErrorReport<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<'a> Debug for GitLabErrorReport<'a>
impl<'a> Debug for GitLabErrorReport<'a>
Source§impl<'a> SubmitErrorReport<'a> for GitLabErrorReport<'a>
impl<'a> SubmitErrorReport<'a> for GitLabErrorReport<'a>
Source§fn new(error: &'a ErrorReport) -> Self
fn new(error: &'a ErrorReport) -> Self
Create a new report wrapper from an error report reference.
Source§fn get_error_report(&self) -> &ErrorReport
fn get_error_report(&self) -> &ErrorReport
Return the
ErrorReport containing the error stack.Source§fn create_message(&self) -> Result<String, ErrorReport>
fn create_message(&self) -> Result<String, ErrorReport>
Create the full user-facing error message with report instructions.
Source§fn 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).
Source§fn 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.Source§fn 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.
Source§fn 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.
Auto Trait Implementations§
impl<'a> Freeze for GitLabErrorReport<'a>
impl<'a> !RefUnwindSafe for GitLabErrorReport<'a>
impl<'a> Send for GitLabErrorReport<'a>
impl<'a> Sync for GitLabErrorReport<'a>
impl<'a> Unpin for GitLabErrorReport<'a>
impl<'a> !UnwindSafe for GitLabErrorReport<'a>
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