pub struct ModuleMetadata {
pub imports: Vec<ModuleDef>,
pub providers: Vec<ProviderDef>,
pub controllers: Vec<ControllerDef>,
pub event_handlers: Vec<EventHandlerDef>,
pub gateways: Vec<GatewayDef>,
/* private fields */
}Fields§
§imports: Vec<ModuleDef>§providers: Vec<ProviderDef>§controllers: Vec<ControllerDef>§event_handlers: Vec<EventHandlerDef>§gateways: Vec<GatewayDef>Implementations§
Source§impl ModuleMetadata
impl ModuleMetadata
pub fn new() -> Self
Sourcepub fn global() -> Self
pub fn global() -> Self
Creates metadata for a global module. Only explicitly exported providers become global.
pub fn import<M: Module + 'static>(self) -> Self
pub fn provider<T: Injectable>(self) -> Self
pub fn provider_async_factory<T, Fut, E>( self, dependencies: Vec<ProviderDependency>, factory: impl Fn(Arc<Container>) -> Fut + Send + Sync + 'static, ) -> Self
pub fn controller<C: Controller + Injectable + 'static>(self) -> Self
pub fn gateway<G: Gateway>(self) -> Self
pub fn event_handler<H>(self) -> Self
pub fn event_handler_for<E, H>(self) -> Self
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
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