[−][src]Crate shaku
Shaku is a compile time dependency injection library. It can be used directly or through
integration with application frameworks such as Rocket (see
shaku_rocket
).
Getting started
See the getting started guide
Crate features
By default shaku is thread-safe and exposes macros, but these can be disabled by opting out of the following features:
thread_safe
: Requires components to beSend + Sync
derive
: Uses theshaku_derive
crate to provide proc-macro derives ofComponent
andProvider
, and themodule
macro.
Modules
guide | Getting started guide |
Macros
module | Create a |
Structs
ModuleBuildContext | Builds a |
ModuleBuilder | Builds a |
Traits
Component | Components provide a service by implementing an interface. They may use other components as dependencies. |
HasComponent | Indicates that a module contains a component which implements the interface. |
HasProvider | Indicates that a module contains a provider which implements the interface. |
Interface | Interfaces must be |
Module | A module represents a group of services. By implementing traits such as |
ModuleInterface | Submodules must be |
Provider | Like |
Type Definitions
ProviderFn | The type signature of |
Derive Macros
Component | |
Provider |