Skip to main content

KernelError

Enum KernelError 

Source
#[non_exhaustive]
pub enum KernelError {
Show 27 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, },
}
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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

MissingProvider

No provider for requested is visible from module.

Fields

§module: &'static str

The module doing the resolving.

§requested: String

The requested provider key.

§required_by: String

What needed it (a provider, exports, a lifecycle registration, …).

§

NotExported

The provider exists in an imported module but that module does not export it.

Fields

§module: &'static str

The module doing the resolving.

§requested: String

The requested provider key.

§owner: &'static str

The module that registers the provider.

§

NotImported

The provider is exported by a module that the requesting module does not import.

Fields

§module: &'static str

The module doing the resolving.

§requested: String

The requested provider key.

§owner: &'static str

The module that registers and exports the provider.

§

AmbiguousProvider

Several different providers of the key are visible (e.g. two imports export it).

Fields

§module: &'static str

The module doing the resolving.

§requested: String

The requested provider key.

§owners: Vec<&'static str>

The modules that own the competing providers.

§

ProviderCycle

A provider dependency cycle (A -> B -> A).

Fields

§path: Vec<String>

The providers on the cycle; the first and last entries are the same.

§

ModuleCycle

A module import cycle (AModule -> BModule -> AModule).

Fields

§path: Vec<&'static str>

The modules on the cycle; the first and last entries are the same.

§

ScopeInversion

A singleton depends (directly or through transients) on a request-scoped provider.

Fields

§module: &'static str

The module that registers the singleton.

§singleton: String

The singleton provider.

§request_scoped: String

The request-scoped provider it reaches.

§

MissingRequestScope

A request-scoped provider was resolved without a RequestScope.

Fields

§provider: String

The request-scoped provider.

§

ConfiguredTwice

Two configured (for_root) instances of the same module.

Fields

§module: &'static str

The module configured twice.

§

DuplicateProvider

The same provider key registered twice in one module.

Fields

§module: &'static str

The module.

§key: String

The duplicated key.

§

Construction

A provider factory or constructor failed.

Fields

§provider: String

The provider being constructed.

§source: BoxError

The underlying error.

§

UnknownCommand

No command with this name is registered.

Fields

§name: String

The requested command name.

§

DuplicateCommand

Two modules register a command with the same name.

Fields

§name: String

The command name.

§first: &'static str

The module that registered it first.

§second: &'static str

The module that registered it again.

§

Lifecycle

A lifecycle hook failed.

Fields

§module: &'static str

The module whose provider implements the hook.

§hook: &'static str

on_init, on_bootstrap or on_shutdown.

§source: BoxError

The underlying error.

§

PluginTwice

A module calls m.plugin(..) more than once.

Fields

§module: &'static str

The module.

§

InvalidNamespace

A plugin’s namespace is not a lower-case letter followed by up to 63 lower-case letters, digits or _.

Fields

§module: &'static str

The module that names the plugin.

§plugin: &'static str

The plugin’s name.

§namespace: &'static str

The namespace it gives.

§

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.

Fields

§module: &'static str

The module.

§plugin: &'static str

The plugin’s name.

§

NamespaceReserved

A plugin that is not first-party uses a namespace the framework keeps.

Fields

§plugin: &'static str

The plugin’s name.

§namespace: &'static str

The reserved namespace.

§

PluginVersions

Two modules name one plugin at two versions.

Fields

§plugin: &'static str

The plugin’s name.

§first: &'static str

The version the first module gives.

§first_module: &'static str

The first module.

§second: &'static str

The other version.

§second_module: &'static str

The module that gives it.

§

PluginInfoDiffers

Two modules describe one plugin (one name, crate and version) differently.

Fields

§plugin: &'static str

The plugin’s name.

§first_module: &'static str

The module whose description counts.

§second_module: &'static str

A module that describes the plugin otherwise.

§

NamespaceTaken

Two plugins use one namespace.

Fields

§namespace: &'static str

The namespace.

§first: &'static str

The plugin that uses it first.

§second: &'static str

The plugin that uses it too.

§

PublishableOutsidePlugin

A module that does not name itself a plugin has files to publish.

Fields

§module: &'static str

The module.

§

UnsafePublishPath

A file a plugin ships has a path that is not safe inside its folder.

Fields

§plugin: &'static str

The plugin’s name.

§tag: &'static str

The file’s tag: views, locales or files.

§path: String

The file’s path, as the plugin gives it.

§

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

§plugin: &'static str

The plugin’s name.

§module: &'static str

The configured module.

§importer: &'static str

The module that imports the configured instance.

§reason: String

Why importer acts for the plugin when it does not name it, in parentheses after a space; empty when it names it.

§

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, or an observer of every commit. The text ends with how the app uses the plugin’s: a module of the app registers it, and for the audit sink, of which an app has one, a module of an app that has no other.

Fields

§plugin: &'static str

The plugin’s name.

§provider: &'static str

The provider’s type name.

§role: &'static str

What the provider does in the app, as a clause after its name.

§module: &'static str

The module that registers it.

§reason: String

Why module acts for the plugin when it does not name it, in parentheses after a space; empty when it names it.

§

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

§plugin: &'static str

The plugin’s name.

§command: &'static str

The command’s name.

§module: &'static str

The module that registers it.

§reason: String

Why module acts for the plugin when it does not name it, in parentheses after a space; empty when it names it.

§

PluginHooksModel

A module that acts for a plugin that is not first-party hooks a model of another crate.

Fields

§plugin: &'static str

The plugin’s name.

§model: &'static str

The model’s type path.

§module: &'static str

The module that registers the hook.

§reason: String

Why module acts for the plugin when it does not name it, in parentheses after a space; empty when it names it.

Trait Implementations§

Source§

impl Debug for KernelError

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for KernelError

Source§

fn fmt(&self, __formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Error for KernelError

Source§

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

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<KernelError> for BootErrors

Source§

fn from(error: KernelError) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more