pub enum DiError {
ServiceNotRegistered {
type_name: String,
},
KeyedServiceNotRegistered {
type_name: String,
key: String,
},
CircularDependency {
type_name: String,
},
ScopeDisposed,
ServiceCreationFailed {
type_name: String,
reason: String,
},
ServiceAlreadyRegistered {
type_name: String,
},
TypeCastingFailed {
type_name: String,
},
ScopedServiceInRootContainer {
type_name: String,
},
Generic {
message: String,
},
}Expand description
Error types for the dependency injection framework
Variants§
ServiceNotRegistered
Service not registered
KeyedServiceNotRegistered
Keyed service not registered
CircularDependency
Circular dependency detected
ScopeDisposed
Scope has been disposed
ServiceCreationFailed
Service creation failed
ServiceAlreadyRegistered
Service already registered
TypeCastingFailed
Type casting failed
ScopedServiceInRootContainer
Scoped service resolved from root container
Generic
Generic error
Implementations§
Source§impl DiError
impl DiError
Sourcepub fn service_not_registered<T: 'static>() -> Self
pub fn service_not_registered<T: 'static>() -> Self
Create service not registered error from TypeId
Sourcepub fn keyed_service_not_registered<T: 'static>(key: &str) -> Self
pub fn keyed_service_not_registered<T: 'static>(key: &str) -> Self
Create keyed service not registered error from TypeId
Sourcepub fn circular_dependency<T: 'static>() -> Self
pub fn circular_dependency<T: 'static>() -> Self
Create circular dependency error from TypeId
Sourcepub fn service_creation_failed<T: 'static>(reason: &str) -> Self
pub fn service_creation_failed<T: 'static>(reason: &str) -> Self
Create service creation failed error from TypeId
Sourcepub fn service_already_registered<T: 'static>() -> Self
pub fn service_already_registered<T: 'static>() -> Self
Create service already registered error from TypeId
Sourcepub fn type_casting_failed<T: 'static>() -> Self
pub fn type_casting_failed<T: 'static>() -> Self
Create type casting failed error from TypeId
Sourcepub fn scoped_service_in_root_container<T: 'static>() -> Self
pub fn scoped_service_in_root_container<T: 'static>() -> Self
Create scoped service in root container error from TypeId
Trait Implementations§
Source§impl Error for DiError
impl Error for DiError
1.30.0§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
Returns the lower-level source of this error, if any. Read more
1.0.0§fn description(&self) -> &str
fn description(&self) -> &str
👎Deprecated since 1.42.0: use the Display impl or to_string()
Auto Trait Implementations§
impl Freeze for DiError
impl RefUnwindSafe for DiError
impl Send for DiError
impl Sync for DiError
impl Unpin for DiError
impl UnwindSafe for DiError
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more