pub enum ValueError {
NotANumber {
raw: String,
source: ParseFloatError,
},
NotAnInteger {
raw: String,
source: ParseIntError,
},
NotABool {
raw: String,
source: ParseBoolError,
},
OutOfRange {
value: String,
min: String,
max: String,
},
UnknownOption {
raw: String,
options: &'static [&'static str],
},
UnknownParam {
id: String,
known: Vec<&'static str>,
},
BadOverride {
raw: String,
},
Param {
id: String,
source: Box<Self>,
},
WrongKind {
expected: ValueKind,
found: ValueKind,
value: String,
},
}Expand description
A parameter value that cannot be read, or does not fit its descriptor.
The source of text that cannot be parsed as its kind is the parser’s error.
Variants§
NotANumber
Text that cannot be parsed as an f32.
NotAnInteger
Text that cannot be parsed as a u32.
NotABool
Text that cannot be parsed as a bool.
OutOfRange
A number outside the descriptor’s inclusive bounds. A non-finite number is outside every bound.
Fields
UnknownOption
Neither the index nor the name of an option.
Fields
UnknownParam
An id no descriptor has.
BadOverride
An override with no = between the id and the value.
Param
A value that parameter id rejects.
WrongKind
A value passed to check_value whose kind differs from the descriptor’s kind.
Trait Implementations§
Source§impl Clone for ValueError
impl Clone for ValueError
Source§impl Debug for ValueError
impl Debug for ValueError
Source§impl Display for ValueError
impl Display for ValueError
impl Eq for ValueError
Source§impl Error for ValueError
impl Error for ValueError
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 PartialEq for ValueError
impl PartialEq for ValueError
impl StructuralPartialEq for ValueError
Auto Trait Implementations§
impl Freeze for ValueError
impl RefUnwindSafe for ValueError
impl Send for ValueError
impl Sync for ValueError
impl Unpin for ValueError
impl UnsafeUnpin for ValueError
impl UnwindSafe for ValueError
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