pub enum ServiceError {
ServiceNotFound {
type_name: &'static str,
},
ServiceAlreadyExists {
type_name: &'static str,
},
ServiceResolutionFailed {
type_name: &'static str,
},
ServiceInitializationFailed {
type_name: &'static str,
error: Box<dyn Error>,
},
ServiceInvalidScope {
type_name: &'static str,
},
}Expand description
Errors that can occur during service registration and resolution.
Variants§
ServiceNotFound
The requested service type was not registered in the container.
ServiceAlreadyExists
Attempted to register a service type that already exists.
ServiceResolutionFailed
Failed to downcast the service to the requested type.
ServiceInitializationFailed
The service factory threw an error during initialization.
ServiceInvalidScope
Attempted to resolve a scoped service from the root provider instead of a scope.
Trait Implementations§
Source§impl Debug for ServiceError
impl Debug for ServiceError
Source§impl Display for ServiceError
impl Display for ServiceError
Source§impl Error for ServiceError
impl Error for ServiceError
1.30.0 · Source§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 · Source§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 ServiceError
impl !RefUnwindSafe for ServiceError
impl !Send for ServiceError
impl !Sync for ServiceError
impl Unpin for ServiceError
impl !UnwindSafe for ServiceError
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more