pub enum GetExampleNumberErrorInternal {
FailedToGetExampleNumber(GetExampleNumberError),
RegexError(InvalidRegexError),
}Expand description
Internal error type used when fetching an example number.
Variants§
FailedToGetExampleNumber(GetExampleNumberError)
Wraps a public GetExampleNumberError for standard failures.
RegexError(InvalidRegexError)
An error indicating that a regular expression was invalid while generating the example. This signals a bug in the library’s metadata.
Implementations§
Source§impl GetExampleNumberErrorInternal
impl GetExampleNumberErrorInternal
Sourcepub fn into_public(self) -> GetExampleNumberError
pub fn into_public(self) -> GetExampleNumberError
Converts an internal error into its public-facing equivalent.
If the error is a RegexError, this method will panic, as this indicates a
non-recoverable library bug that should be fixed.
Trait Implementations§
Source§impl Error for GetExampleNumberErrorInternal
impl Error for GetExampleNumberErrorInternal
Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Source§impl From<GetExampleNumberError> for GetExampleNumberErrorInternal
impl From<GetExampleNumberError> for GetExampleNumberErrorInternal
Source§fn from(source: GetExampleNumberError) -> Self
fn from(source: GetExampleNumberError) -> Self
Converts to this type from the input type.
Source§impl From<InvalidRegexError> for GetExampleNumberErrorInternal
impl From<InvalidRegexError> for GetExampleNumberErrorInternal
Source§fn from(source: InvalidRegexError) -> Self
fn from(source: InvalidRegexError) -> Self
Converts to this type from the input type.
Source§impl From<ParseErrorInternal> for GetExampleNumberErrorInternal
impl From<ParseErrorInternal> for GetExampleNumberErrorInternal
Source§fn from(value: ParseErrorInternal) -> Self
fn from(value: ParseErrorInternal) -> Self
Converts an internal parsing error into an internal “get example number” error. This is used to propagate errors within the library’s logic.
Source§impl PartialEq for GetExampleNumberErrorInternal
impl PartialEq for GetExampleNumberErrorInternal
Source§fn eq(&self, other: &GetExampleNumberErrorInternal) -> bool
fn eq(&self, other: &GetExampleNumberErrorInternal) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for GetExampleNumberErrorInternal
Auto Trait Implementations§
impl Freeze for GetExampleNumberErrorInternal
impl RefUnwindSafe for GetExampleNumberErrorInternal
impl Send for GetExampleNumberErrorInternal
impl Sync for GetExampleNumberErrorInternal
impl Unpin for GetExampleNumberErrorInternal
impl UnwindSafe for GetExampleNumberErrorInternal
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