pub enum Error {
DefaultParse {
source: TomlError,
},
UserParse {
source: TomlError,
},
DefaultsDeclareNoKeys,
MigrationPath {
source: TomlError,
},
SetPath {
source: TomlError,
},
NotAValue {
path: String,
},
}Expand description
A document that could not be parsed. Which one is part of the error, because a broken default document is the application’s fault and a broken user document is the person’s.
Variants§
DefaultParse
The shipped default document failed to parse.
UserParse
The user’s document failed to parse.
DefaultsDeclareNoKeys
The defaults parsed and hold text, but declare no keys and document none either.
A defaults document made only of the maintainers’ own notes has nothing
to merge into and nothing to say. That is an application bug, so it
fails here instead of becoming a state the merge has to carry. A
document of marker lines alone is not this: an option anchored on a key
the application ships no value for is documented without declaring
anything, and a defaults file of nothing but such blocks is a whole
configuration. A zero-byte defaults document is a separate case and is
allowed, see SourceDocument::Empty.
MigrationPath
A rename rule was given a path that is not a TOML key path.
SetPath
Merged::set was given a path that is not a
TOML key path.
NotAValue
Merged::set was given a path where a table or
an array of tables already sits. Writing a value there would throw
away everything under it.
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)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()