pub trait Provider:
FromState
+ Send
+ Sync { }Expand description
Marker trait for pre-instantiated dependencies (providers).
Providers are dependencies that have been pre-constructed and registered into the State. Unlike Components which are built from their dependencies, Providers are already complete instances that only need to be retrieved from the State via the FromState trait.
Common use cases: database connections, external API clients, or any resource that requires async initialization or complex setup.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".