GetExampleNumberErrorInternal

Enum GetExampleNumberErrorInternal 

Source
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

Source

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 Debug for GetExampleNumberErrorInternal

Source§

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

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

impl Display for GetExampleNumberErrorInternal

Source§

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

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

impl Error for GetExampleNumberErrorInternal

Source§

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

👎Deprecated since 1.42.0: use the Display impl or to_string()
1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<GetExampleNumberError> for GetExampleNumberErrorInternal

Source§

fn from(source: GetExampleNumberError) -> Self

Converts to this type from the input type.
Source§

impl From<InvalidRegexError> for GetExampleNumberErrorInternal

Source§

fn from(source: InvalidRegexError) -> Self

Converts to this type from the input type.
Source§

impl From<ParseErrorInternal> for GetExampleNumberErrorInternal

Source§

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

Source§

fn eq(&self, other: &GetExampleNumberErrorInternal) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for GetExampleNumberErrorInternal

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.