pub enum ConfigError {
NotFound {
path: String,
field: String,
},
TypeMismatch {
path: String,
field: String,
stored: &'static str,
requested: &'static str,
},
}Expand description
Why a get failed. SystemVerilog collapses all of these into return 0
and leaves your variable untouched; naming them is the point.
Variants§
NotFound
No entry matched the resolved path and field. Covers “never set”, “path does not match” and “field misspelled” — indistinguishable to any database addressed by strings, which is why ch28 exists.
TypeMismatch
An entry was found, but it holds another type. Only reportable because the type is not part of the key (D65).
Implementations§
Trait Implementations§
Source§impl Clone for ConfigError
impl Clone for ConfigError
Source§fn clone(&self) -> ConfigError
fn clone(&self) -> ConfigError
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ConfigError
impl Debug for ConfigError
Source§impl Display for ConfigError
impl Display for ConfigError
impl Eq for ConfigError
Source§impl Error for ConfigError
impl Error for ConfigError
1.30.0 · 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<ConfigError> for TestError
Configuration failures keep their cause, so ? in a test body still
lets expect_error distinguish “nothing was set” from “wrong type”.
impl From<ConfigError> for TestError
Configuration failures keep their cause, so ? in a test body still
lets expect_error distinguish “nothing was set” from “wrong type”.
Source§fn from(e: ConfigError) -> Self
fn from(e: ConfigError) -> Self
Converts to this type from the input type.
Source§impl From<ConfigError> for SeqError
impl From<ConfigError> for SeqError
Source§fn from(e: ConfigError) -> SeqError
fn from(e: ConfigError) -> SeqError
Converts to this type from the input type.
Source§impl PartialEq for ConfigError
impl PartialEq for ConfigError
impl StructuralPartialEq for ConfigError
Auto Trait Implementations§
impl Freeze for ConfigError
impl RefUnwindSafe for ConfigError
impl Send for ConfigError
impl Sync for ConfigError
impl Unpin for ConfigError
impl UnsafeUnpin for ConfigError
impl UnwindSafe for ConfigError
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