pub struct ServiceContainer { /* private fields */ }Expand description
服务容器
Implementations§
Source§impl ServiceContainer
impl ServiceContainer
Sourcepub fn register_config_manager(self, component: Arc<dyn ConfigManager>) -> Self
pub fn register_config_manager(self, component: Arc<dyn ConfigManager>) -> Self
注册组件
pub fn register_dependency_resolver( self, component: Arc<dyn DependencyResolver>, ) -> Self
pub fn register_service_discovery( self, component: Arc<dyn ServiceDiscovery>, ) -> Self
pub fn register_network_validator( self, component: Arc<dyn NetworkValidator>, ) -> Self
pub fn register_fingerprint_validator( self, component: Arc<dyn FingerprintValidator>, ) -> Self
pub fn register_proto_processor( self, component: Arc<dyn ProtoProcessor>, ) -> Self
pub fn register_cache_manager(self, component: Arc<dyn CacheManager>) -> Self
pub fn register_user_interface(self, component: Arc<dyn UserInterface>) -> Self
Sourcepub fn get_config_manager(&self) -> Result<Arc<dyn ConfigManager>>
pub fn get_config_manager(&self) -> Result<Arc<dyn ConfigManager>>
获取组件
pub fn get_dependency_resolver(&self) -> Result<Arc<dyn DependencyResolver>>
pub fn get_service_discovery(&self) -> Result<Arc<dyn ServiceDiscovery>>
pub fn get_network_validator(&self) -> Result<Arc<dyn NetworkValidator>>
pub fn get_fingerprint_validator(&self) -> Result<Arc<dyn FingerprintValidator>>
pub fn get_proto_processor(&self) -> Result<Arc<dyn ProtoProcessor>>
pub fn get_cache_manager(&self) -> Result<Arc<dyn CacheManager>>
pub fn get_user_interface(&self) -> Result<Arc<dyn UserInterface>>
Sourcepub fn get_validation_pipeline(&mut self) -> Result<Arc<ValidationPipeline>>
pub fn get_validation_pipeline(&mut self) -> Result<Arc<ValidationPipeline>>
获取验证管道 (延迟创建)
Sourcepub fn get_install_pipeline(&mut self) -> Result<Arc<InstallPipeline>>
pub fn get_install_pipeline(&mut self) -> Result<Arc<InstallPipeline>>
获取安装管道 (延迟创建)
Sourcepub fn get_generation_pipeline(&mut self) -> Result<Arc<GenerationPipeline>>
pub fn get_generation_pipeline(&mut self) -> Result<Arc<GenerationPipeline>>
获取生成管道 (延迟创建)
Sourcepub fn validate(&self, required_components: &[ComponentType]) -> Result<()>
pub fn validate(&self, required_components: &[ComponentType]) -> Result<()>
验证所有必需的组件是否已注册
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ServiceContainer
impl !RefUnwindSafe for ServiceContainer
impl Send for ServiceContainer
impl Sync for ServiceContainer
impl Unpin for ServiceContainer
impl !UnwindSafe for ServiceContainer
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more