Skip to main content

ConfigProblem

Enum ConfigProblem 

Source
#[non_exhaustive]
pub enum ConfigProblem {
Show 23 variants Zero, Negative, NotFinite, NotWholeNumber, TooLarge { max: u64, }, NotSet, NoneProvided, NoParent, NotSupported, CannotTargetSink, RemovesWholeName { path: PathBuf, }, NotAtStart, Empty, BlankOrControl, PaddedWithBlank, ContainsSeparator, InnerDot, DotEntry, NotOneOf { allowed: &'static [&'static str], }, NotCreatable { format: ExtractOnlyFormat, }, TooLong { max: usize, got: usize, }, ContainsNul, ExcludePatternRefused { pattern: String, reason: ExcludeRefusal, },
}
Expand description

Why a configuration value or input was refused.

§Examples

use exarch_core::ConfigProblem;

assert_eq!(ConfigProblem::Zero.to_string(), "must not be zero");

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Zero

A limit is zero.

§

Negative

A byte count is negative.

§

NotFinite

A number is NaN or infinite.

§

NotWholeNumber

A number has a fractional part.

§

TooLarge

A number is above the largest accepted value.

Fields

§max: u64

The largest accepted value.

§

NotSet

A required input is missing.

§

NoneProvided

No input of this kind was given.

§

NoParent

The path has no parent directory.

§

NotSupported

The operation is not supported for this input.

§

CannotTargetSink

Atomic extraction cannot target a sink.

§

RemovesWholeName

The prefix would remove the whole name of this path.

Fields

§path: PathBuf

The path that would be left without a name.

§

NotAtStart

The writer is not at offset zero.

§

Empty

The entry is empty.

§

BlankOrControl

The entry has whitespace or control characters.

§

PaddedWithBlank

The entry starts or ends with whitespace or control characters.

§

ContainsSeparator

The entry contains a path separator.

§

InnerDot

The extension has an inner dot.

§

DotEntry

The entry is . or ...

§

NotOneOf

The value is not one of the allowed values.

Fields

§allowed: &'static [&'static str]

The accepted string forms.

§

NotCreatable

The format can be read but not created.

Fields

§format: ExtractOnlyFormat

The extract-only format that was asked for.

§

TooLong

The entry is longer than the maximum.

Fields

§max: usize

The longest accepted length in bytes.

§got: usize

The length of the entry in bytes.

§

ContainsNul

The entry contains a NUL byte.

§

ExcludePatternRefused

A creation exclude pattern the matcher does not support.

Fields

§pattern: String

The refused pattern text, cut to the maximum entry length.

§reason: ExcludeRefusal

Why the pattern is refused.

Trait Implementations§

Source§

impl Clone for ConfigProblem

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for ConfigProblem

Source§

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

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

impl Display for ConfigProblem

Source§

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

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

impl Eq for ConfigProblem

Source§

impl PartialEq for ConfigProblem

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for ConfigProblem

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> 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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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> Same for T

Source§

type Output = T

Should always be Self
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> 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 = !

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

fn try_from(value: U) -> Result<T, !>

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.