#[non_exhaustive]pub enum RegistryError {
Show 19 variants
DuplicateCommand(String),
UnknownCommand(String),
SugarMismatch(String),
AlreadyBound(Sugar),
InvalidName(String),
DuplicatePackage(String),
MissingDependency {
package: String,
dependency: String,
},
DependencyCycle(String),
QueryWithoutValue(String),
UnsupportedVarType(String),
InvalidVarValue(String),
DuplicateType(String),
UnknownType {
name: String,
used_by: String,
},
RecursiveType(String),
InvalidMapKey(String),
TypeTooDeep(String),
InvalidTypeDecl(String),
NoCommand,
InvalidParams(String),
}Expand description
A registry error.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
DuplicateCommand(String)
A command (or variable) with the same name was registered twice.
UnknownCommand(String)
Tried to bind a command that is not registered.
SugarMismatch(String)
The types of the command to bind do not match the parameter shape of the sugar.
AlreadyBound(Sugar)
The same kind of sugar was bound twice.
InvalidName(String)
The name is invalid (not an identifier, or the first half of the package name differs from Package::NAME).
DuplicatePackage(String)
A package with the same name was registered twice.
MissingDependency
A package declared in DEPENDS is neither registered nor in the same bulk registration.
DependencyCycle(String)
Package dependencies form a cycle (including a dependency on itself).
QueryWithoutValue(String)
The return type of a query is () (a query that returns no value cannot be made).
UnsupportedVarType(String)
The type of a variable cannot be used (it contains ()).
InvalidVarValue(String)
The initial value of a variable is NaN or ±∞ (which never appear as script values), or does not match the type of
the variable.
DuplicateType(String)
A type with the same name was registered twice.
UnknownType
A type used by a type, command or variable is not registered yet (types are registered before they are used).
Fields
RecursiveType(String)
A type contains itself (even directly).
InvalidMapKey(String)
Uses a type that cannot be a map key (float, list, map, Option, and so on). The argument is the name of the
user.
TypeTooDeep(String)
The nesting of types is too deep (MAX_TYPE_DEPTH). The argument is the name of the user.
InvalidTypeDecl(String)
A type declaration is invalid (names of fields or variants are not identifiers or collide, there are no variants, or a
field is ()).
NoCommand
There is no command to attach an alias, description or parameter names to (no command was registered just before).
InvalidParams(String)
The number of parameter names differs from the number of parameters of the command. Or a default has no name, has the wrong type, or parameters with defaults are not at the end.
Trait Implementations§
Source§impl Clone for RegistryError
impl Clone for RegistryError
Source§impl Debug for RegistryError
impl Debug for RegistryError
Source§impl Display for RegistryError
impl Display for RegistryError
impl Eq for RegistryError
Source§impl Error for RegistryError
impl Error for RegistryError
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()