pub struct ServiceRegistration {
pub lifetime: ServiceLifetime,
pub type_id: TypeId,
pub type_name_fn: fn() -> &'static str,
pub factory: fn(&dyn IServiceResolver) -> Arc<dyn Any + Send + Sync>,
}Expand description
A runtime service registration collected via inventory::submit!.
Each #[rust_dicore::inject(...)] on a struct generates one submission.
type_name_fn is a function pointer (not a string) to avoid requiring
std::any::type_name::<T>() in a const context (tracking issue #63084).
The function is called at runtime by from_injected().
Fields§
§lifetime: ServiceLifetime§type_id: TypeId§type_name_fn: fn() -> &'static str§factory: fn(&dyn IServiceResolver) -> Arc<dyn Any + Send + Sync>Trait Implementations§
impl Collect for ServiceRegistration
Auto Trait Implementations§
impl Freeze for ServiceRegistration
impl RefUnwindSafe for ServiceRegistration
impl Send for ServiceRegistration
impl Sync for ServiceRegistration
impl Unpin for ServiceRegistration
impl UnsafeUnpin for ServiceRegistration
impl UnwindSafe for ServiceRegistration
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