pub struct ModuleDescriptor {
pub name: String,
pub version: Option<String>,
pub description: Option<String>,
pub providers: Vec<ServiceDescriptor>,
pub controllers: Vec<ControllerDescriptor>,
pub imports: Vec<String>,
pub exports: Vec<String>,
pub dependencies: Vec<String>,
pub is_optional: bool,
}
Expand description
Complete module descriptor with all metadata and auto-configuration
Fields§
§name: String
Module name for identification
version: Option<String>
Module version for compatibility
description: Option<String>
Module description
providers: Vec<ServiceDescriptor>
Service providers defined in this module
controllers: Vec<ControllerDescriptor>
Controllers defined in this module
imports: Vec<String>
Other modules that this module imports
exports: Vec<String>
Services that this module exports to other modules
dependencies: Vec<String>
Dependencies that must be loaded first
is_optional: bool
Whether this module can be disabled
Implementations§
Source§impl ModuleDescriptor
impl ModuleDescriptor
Sourcepub fn with_version(self, version: impl Into<String>) -> Self
pub fn with_version(self, version: impl Into<String>) -> Self
Set module version
Sourcepub fn with_description(self, description: impl Into<String>) -> Self
pub fn with_description(self, description: impl Into<String>) -> Self
Set module description
Sourcepub fn with_provider(self, provider: ServiceDescriptor) -> Self
pub fn with_provider(self, provider: ServiceDescriptor) -> Self
Add a service provider
Sourcepub fn with_providers(self, providers: Vec<ServiceDescriptor>) -> Self
pub fn with_providers(self, providers: Vec<ServiceDescriptor>) -> Self
Add multiple service providers
Sourcepub fn with_controller(self, controller: ControllerDescriptor) -> Self
pub fn with_controller(self, controller: ControllerDescriptor) -> Self
Add a controller
Sourcepub fn with_controllers(self, controllers: Vec<ControllerDescriptor>) -> Self
pub fn with_controllers(self, controllers: Vec<ControllerDescriptor>) -> Self
Add multiple controllers
Sourcepub fn with_imports(self, imports: Vec<String>) -> Self
pub fn with_imports(self, imports: Vec<String>) -> Self
Set module imports
Sourcepub fn with_exports(self, exports: Vec<String>) -> Self
pub fn with_exports(self, exports: Vec<String>) -> Self
Set module exports
Sourcepub fn with_dependencies(self, dependencies: Vec<String>) -> Self
pub fn with_dependencies(self, dependencies: Vec<String>) -> Self
Set module dependencies
Sourcepub fn with_optional(self, is_optional: bool) -> Self
pub fn with_optional(self, is_optional: bool) -> Self
Set if module is optional
Sourcepub fn service_count(&self) -> usize
pub fn service_count(&self) -> usize
Get total service count
Sourcepub fn controller_count(&self) -> usize
pub fn controller_count(&self) -> usize
Get total controller count
Sourcepub fn has_exports(&self) -> bool
pub fn has_exports(&self) -> bool
Check if module has exports
Sourcepub fn has_imports(&self) -> bool
pub fn has_imports(&self) -> bool
Check if module has imports
Trait Implementations§
Source§impl Clone for ModuleDescriptor
impl Clone for ModuleDescriptor
Source§fn clone(&self) -> ModuleDescriptor
fn clone(&self) -> ModuleDescriptor
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 ModuleDescriptor
impl RefUnwindSafe for ModuleDescriptor
impl Send for ModuleDescriptor
impl Sync for ModuleDescriptor
impl Unpin for ModuleDescriptor
impl UnwindSafe for ModuleDescriptor
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