Skip to main content

GitLabErrorReport

Struct GitLabErrorReport 

Source
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 ErrorReport

Reference to the error report being submitted.

Implementations§

Source§

impl<'a> GitLabErrorReport<'a>

Source

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.

Source

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>

Source§

fn clone(&self) -> GitLabErrorReport<'a>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Debug for GitLabErrorReport<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> SubmitErrorReport<'a> for GitLabErrorReport<'a>

Source§

fn new(error: &'a ErrorReport) -> Self

Create a new report wrapper from an error report reference.
Source§

fn get_error_report(&self) -> &ErrorReport

Return the ErrorReport containing the error stack.
Source§

fn get_title(&self) -> String

Return the title of the error.
Source§

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>

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>

Create a pre-filled issue URL, progressively removing detail to stay under max_length.
Source§

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>

Create a URL to search for existing reports with the same title.
Source§

fn truncate_string(text: String, limit: usize) -> String

Truncate a string to the given limit, respecting character boundaries.

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more