pub enum Error {
UnknownKey(String),
ScopeNotAllowed {
key: String,
scope: Scope,
allowed: Vec<Scope>,
},
InvalidValue {
key: String,
message: String,
},
SecretOnCommandLine(String),
Duplicate(String),
Reserved {
key: String,
name: String,
},
InvalidDef {
key: String,
message: String,
},
Unparsable {
file: PathBuf,
message: String,
},
Rejected(Vec<FieldError>),
Io(Error),
}Expand description
Why a settings operation failed.
Variants§
UnknownKey(String)
No setting has this key.
ScopeNotAllowed
The key exists but may not be set in this scope.
Fields
InvalidValue
The value does not fit the key’s kind.
SecretOnCommandLine(String)
A secret was given as text on the command line.
Duplicate(String)
Two owners define the same key.
Reserved
A key uses a top-level name reserved for another owner.
InvalidDef
A definition breaks the registry’s rules: it names no scope, or it is a secret outside the device scope.
Unparsable
A settings file is not valid TOML, or holds a value of an unsupported type.
Rejected(Vec<FieldError>)
An owner refused the edited settings.
Io(Error)
A filesystem error.
Implementations§
Source§impl Error
impl Error
Sourcepub fn field_errors(&self) -> Vec<ConfigFieldError>
pub fn field_errors(&self) -> Vec<ConfigFieldError>
The keys this error names, for a client to show under each field; empty when it names none. The messages never hold a value.
Trait Implementations§
Source§impl Error for Error
impl Error for Error
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()
Auto Trait Implementations§
impl !RefUnwindSafe for Error
impl !UnwindSafe for Error
impl Forget for Error
impl Freeze for Error
impl Move for Error
impl Send for Error
impl Sync for Error
impl Unpin for Error
impl UnsafeUnpin for Error
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