pub struct ServiceDescriptor {
pub service_name: String,
pub service_type: TypeId,
pub implementation_type: Option<TypeId>,
pub name: Option<String>,
pub lifecycle: ServiceLifecycle,
pub is_trait_service: bool,
pub dependencies: Vec<TypeId>,
}
Expand description
Service provider definition with complete metadata
Fields§
§service_name: String
Service type name for debugging
service_type: TypeId
Service type ID for resolution
implementation_type: Option<TypeId>
Implementation type ID (if different from service)
name: Option<String>
Named binding identifier
lifecycle: ServiceLifecycle
Service lifecycle management
is_trait_service: bool
Whether this service implements a trait
dependencies: Vec<TypeId>
Dependencies that must be resolved first
Implementations§
Source§impl ServiceDescriptor
impl ServiceDescriptor
Sourcepub fn new<S: 'static>(
service_name: impl Into<String>,
lifecycle: ServiceLifecycle,
) -> Self
pub fn new<S: 'static>( service_name: impl Into<String>, lifecycle: ServiceLifecycle, ) -> Self
Create a new service descriptor
Sourcepub fn trait_mapping<S: 'static, I: 'static>(
service_name: impl Into<String>,
implementation_name: impl Into<String>,
lifecycle: ServiceLifecycle,
) -> Self
pub fn trait_mapping<S: 'static, I: 'static>( service_name: impl Into<String>, implementation_name: impl Into<String>, lifecycle: ServiceLifecycle, ) -> Self
Create a service descriptor for trait mapping
Sourcepub fn with_dependencies(self, dependencies: Vec<TypeId>) -> Self
pub fn with_dependencies(self, dependencies: Vec<TypeId>) -> Self
Set service dependencies
Trait Implementations§
Source§impl Clone for ServiceDescriptor
impl Clone for ServiceDescriptor
Source§fn clone(&self) -> ServiceDescriptor
fn clone(&self) -> ServiceDescriptor
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreAuto Trait Implementations§
impl Freeze for ServiceDescriptor
impl RefUnwindSafe for ServiceDescriptor
impl Send for ServiceDescriptor
impl Sync for ServiceDescriptor
impl Unpin for ServiceDescriptor
impl UnwindSafe for ServiceDescriptor
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