pub enum InjectableError {
CircularDependency {
type_name: &'static str,
chain: Vec<&'static str>,
},
MissingDependency {
type_name: &'static str,
},
ConstructionFailed {
type_name: &'static str,
reason: String,
},
LifecycleHookFailed {
type_name: &'static str,
hook: &'static str,
reason: String,
},
ShutdownFailed {
errors: Vec<InjectableError>,
},
ContainerNotBuilt,
GraphValidationFailed {
errors: Vec<String>,
},
}Expand description
Errors that can occur during dependency resolution.
Variants§
CircularDependency
A circular dependency was detected during resolution.
Fields
MissingDependency
A required dependency was not found in the container.
ConstructionFailed
Constructor invocation failed.
Fields
LifecycleHookFailed
A lifecycle hook (post_construct / pre_destruct) failed.
Fields
ShutdownFailed
One or more pre_destruct hooks failed during container shutdown.
All destructors are still called (best-effort cleanup), but
this error collects any failures that occurred. Inspect
errors for details on each individual failure.
Fields
errors: Vec<InjectableError>The individual errors from failed pre_destruct hooks.
ContainerNotBuilt
Container has not been built yet.
GraphValidationFailed
The dependency graph is structurally invalid.
Returned only from Container::builder().build() when circular
dependencies, missing dependencies, scope mismatches, or duplicate
registrations are detected at build time.
Semantically distinct from ConstructionFailed (which is a runtime
provider error): GraphValidationFailed means the type wiring is wrong
and must be fixed in code, not retried.
Trait Implementations§
Source§impl Clone for InjectableError
impl Clone for InjectableError
Source§fn clone(&self) -> InjectableError
fn clone(&self) -> InjectableError
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for InjectableError
impl Debug for InjectableError
Source§impl Display for InjectableError
impl Display for InjectableError
Source§impl Error for InjectableError
impl Error for InjectableError
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()