pub enum PresetError {
Toml(Error),
UnknownSystem(String),
Expr {
param: String,
err: ExprError,
},
Config(String),
Io(String),
}Expand description
Why a preset failed to load. Every variant is recoverable — the caller keeps the previous good preset.
Variants§
Toml(Error)
The TOML itself was malformed.
UnknownSystem(String)
system named a built-in that does not exist.
Expr
A parameter’s expression failed to compile.
Config(String)
A structural-config table ([curve]/[generator]) was invalid — an
unknown family, an out-of-range value, an undefined grammar symbol.
Io(String)
The preset file could not be read (message from the I/O error).
Implementations§
Source§impl PresetError
impl PresetError
Sourcepub fn span(&self) -> Option<Range<usize>>
pub fn span(&self) -> Option<Range<usize>>
The byte range in the preset source this error points at, when the parser gave one.
Only the TOML arm can have one: every other variant is raised by the loader’s own validation, which runs against parsed values rather than against the document, and a value carries no position. A caller turns the offset into a line and column against the source it read — which it still has and this module never did.
Trait Implementations§
Source§impl Debug for PresetError
impl Debug for PresetError
Source§impl Display for PresetError
impl Display for PresetError
Source§impl Error for PresetError
impl Error for PresetError
1.30.0 · 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()