#[non_exhaustive]pub enum KernelError {
Show 30 variants
MissingProvider {
module: &'static str,
requested: String,
required_by: String,
},
NotExported {
module: &'static str,
requested: String,
owner: &'static str,
},
NotImported {
module: &'static str,
requested: String,
owner: &'static str,
},
AmbiguousProvider {
module: &'static str,
requested: String,
owners: Vec<&'static str>,
},
ProviderCycle {
path: Vec<String>,
},
ModuleCycle {
path: Vec<&'static str>,
},
ScopeInversion {
module: &'static str,
singleton: String,
request_scoped: String,
},
MissingRequestScope {
provider: String,
},
ConfiguredTwice {
module: &'static str,
},
DuplicateProvider {
module: &'static str,
key: String,
},
Construction {
provider: String,
source: BoxError,
},
UnknownCommand {
name: String,
},
DuplicateCommand {
name: String,
first: &'static str,
second: &'static str,
},
Lifecycle {
module: &'static str,
hook: &'static str,
source: BoxError,
},
PluginTwice {
module: &'static str,
},
InvalidNamespace {
module: &'static str,
plugin: &'static str,
namespace: &'static str,
},
PluginOfAnotherCrate {
module: &'static str,
plugin: &'static str,
},
NamespaceReserved {
plugin: &'static str,
namespace: &'static str,
},
PluginVersions {
plugin: &'static str,
first: &'static str,
first_module: &'static str,
second: &'static str,
second_module: &'static str,
},
PluginInfoDiffers {
plugin: &'static str,
first_module: &'static str,
second_module: &'static str,
},
NamespaceTaken {
namespace: &'static str,
first: &'static str,
second: &'static str,
},
PublishableOutsidePlugin {
module: &'static str,
},
UnsafePublishPath {
plugin: &'static str,
tag: &'static str,
path: String,
},
PluginConfiguresModule {
plugin: &'static str,
module: &'static str,
importer: &'static str,
reason: String,
},
PluginProvidesAppOnly {
plugin: &'static str,
provider: &'static str,
role: &'static str,
module: &'static str,
reason: String,
},
PluginCommand {
plugin: &'static str,
command: &'static str,
module: &'static str,
reason: String,
},
PluginHooksModel {
plugin: &'static str,
model: &'static str,
module: &'static str,
reason: String,
},
DuplicateModuleId {
module: &'static str,
id_type: &'static str,
first: &'static str,
second: &'static str,
},
PluginExportsProvider {
plugin: &'static str,
provider: String,
module: &'static str,
reason: String,
other: &'static str,
also_exported: bool,
},
PluginExportsFrameworkProvider {
plugin: &'static str,
provider: String,
module: &'static str,
reason: String,
},
}Expand description
An error raised while validating the module graph, resolving a provider, running a lifecycle hook or dispatching a command.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
MissingProvider
No provider for requested is visible from module.
Fields
NotExported
The provider exists in an imported module but that module does not export it.
Fields
NotImported
The provider is exported by a module that the requesting module does not import.
Fields
AmbiguousProvider
Several different providers of the key are visible (e.g. two imports export it).
Fields
ProviderCycle
A provider dependency cycle (A -> B -> A).
ModuleCycle
A module import cycle (AModule -> BModule -> AModule).
ScopeInversion
A singleton depends (directly or through transients) on a request-scoped provider.
Fields
MissingRequestScope
A request-scoped provider was resolved without a RequestScope.
ConfiguredTwice
Two configured (for_root) instances of the same module.
DuplicateProvider
The same provider key registered twice in one module.
Construction
A provider factory or constructor failed.
UnknownCommand
No command with this name is registered.
DuplicateCommand
Two modules register a command with the same name.
Fields
Lifecycle
A lifecycle hook failed.
Fields
PluginTwice
A module calls m.plugin(..) more than once.
InvalidNamespace
A plugin’s namespace is not a lower-case letter followed by up to 63
lower-case letters, digits or _.
Fields
PluginOfAnotherCrate
A module names a plugin of another crate: its type names no path of the plugin’s crate, or another module gives the plugin another crate.
NamespaceReserved
A plugin that is not first-party uses a namespace the framework keeps.
PluginVersions
Two modules name one plugin at two versions.
Fields
PluginInfoDiffers
Two modules describe one plugin (one name, crate and version) differently.
Fields
NamespaceTaken
Two plugins use one namespace.
Fields
PublishableOutsidePlugin
A module that does not name itself a plugin has files to publish.
UnsafePublishPath
A file a plugin ships has a path that is not safe inside its folder.
Fields
PluginConfiguresModule
A module that acts for a plugin that is not first-party imports a configured instance of a module whose type does not name the plugin’s crate.
Fields
PluginProvidesAppOnly
A module that acts for a plugin that is not first-party registers a
provider that only the app registers: one that decides who may do what
in the app, the options of such a module, the app’s shell, its clock,
its audit sink, or an observer of every commit. The text ends with how
the app uses the plugin’s: a module of the app registers it (or adds the
audit sink with ModuleBuilderAuditExt).
Fields
PluginCommand
A module that acts for a plugin that is not first-party registers a command with the name of one of the framework’s own.
Fields
PluginHooksModel
A module that acts for a plugin that is not first-party hooks a model of another crate.
Fields
DuplicateModuleId
Two module values from different crates return the same ModuleId.
Fields
PluginExportsProvider
A module that acts for a plugin that is not first-party exports a
non-multi provider key that another module also registers, which would
either replace that module’s unexported provider in app-wide lookups or
make app-wide lookups of the key answer None.
Fields
PluginExportsFrameworkProvider
A module that acts for a plugin that is not first-party exports a non-multi provider whose outer type belongs to a framework crate and names no type of the plugin’s own crate.
Trait Implementations§
Source§impl Debug for KernelError
impl Debug for KernelError
Source§impl Display for KernelError
impl Display for KernelError
Source§impl Error for KernelError
impl Error for KernelError
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()