pub struct ModuleMetadata {
pub imports: Vec<ModuleDef>,
pub providers: Vec<ProviderDef>,
pub controllers: Vec<ControllerDef>,
pub event_handlers: Vec<EventHandlerDef>,
pub gateways: Vec<GatewayDef>,
pub microservices: Vec<MicroserviceDef>,
/* private fields */
}Expand description
Re-exported public API.
Public Caelix type ModuleMetadata.
Fields§
§imports: Vec<ModuleDef>The imports value.
providers: Vec<ProviderDef>The providers value.
controllers: Vec<ControllerDef>The controllers value.
event_handlers: Vec<EventHandlerDef>The event_handlers value.
gateways: Vec<GatewayDef>The gateways value.
microservices: Vec<MicroserviceDef>The dependency-injected microservice classes declared by this module.
Implementations§
Source§impl ModuleMetadata
impl ModuleMetadata
Sourcepub fn global() -> Self
pub fn global() -> Self
Creates metadata for a global module. Only explicitly exported providers become global.
Sourcepub fn provider<T: Injectable>(self) -> Self
pub fn provider<T: Injectable>(self) -> Self
Runs the provider public API operation.
Sourcepub fn provider_async_factory<T, Fut, E>(
self,
dependencies: Vec<ProviderDependency>,
factory: impl Fn(Arc<Container>) -> Fut + Send + Sync + 'static,
) -> Self
pub fn provider_async_factory<T, Fut, E>( self, dependencies: Vec<ProviderDependency>, factory: impl Fn(Arc<Container>) -> Fut + Send + Sync + 'static, ) -> Self
Runs the provider_async_factory public API operation.
Sourcepub fn controller<C: Controller + Injectable + 'static>(self) -> Self
pub fn controller<C: Controller + Injectable + 'static>(self) -> Self
Runs the controller public API operation.
Sourcepub fn microservice<T: Microservice>(self) -> Self
pub fn microservice<T: Microservice>(self) -> Self
Registers a dependency-injected microservice and all of its message handlers.
A microservice is already a provider; do not additionally register it
with Self::provider.
Sourcepub fn event_handler<H>(self) -> Self
pub fn event_handler<H>(self) -> Self
Runs the event_handler public API operation.
Sourcepub fn event_handler_for<E, H>(self) -> Self
pub fn event_handler_for<E, H>(self) -> Self
Runs the event_handler_for public API operation.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for ModuleMetadata
impl !UnwindSafe for ModuleMetadata
impl Freeze for ModuleMetadata
impl Send for ModuleMetadata
impl Sync for ModuleMetadata
impl Unpin for ModuleMetadata
impl UnsafeUnpin for ModuleMetadata
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