pub struct DeclaredDependency {
pub type_id: fn() -> TypeId,
pub type_name: &'static str,
}Expand description
A dependency declaration collected at link time via inventory.
Available when the validation feature is enabled.
Each #[derive(Injectable)] struct registers one DeclaredDependency
entry per field type. Container::validate iterates all collected
entries at startup to confirm every required type is present.
You rarely construct this manually; use declare_dependency! instead.
Fields§
§type_id: fn() -> TypeIdA function pointer returning the TypeId of the required type.
Stored as a fn pointer rather than a value because TypeId is not
usable in const contexts on stable/nightly without a feature flag.
type_name: &'static strHuman-readable name of the type, produced by stringify!.
Trait Implementations§
impl Collect for DeclaredDependency
Auto Trait Implementations§
impl Freeze for DeclaredDependency
impl RefUnwindSafe for DeclaredDependency
impl Send for DeclaredDependency
impl Sync for DeclaredDependency
impl Unpin for DeclaredDependency
impl UnsafeUnpin for DeclaredDependency
impl UnwindSafe for DeclaredDependency
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