pub trait ProviderConfig:
Clone
+ Debug
+ Send
+ Sync {
type Provider;
// Required methods
fn build(self) -> Result<Self::Provider, ConfigError>;
fn validate(&self) -> Result<(), ConfigError>;
}
Expand description
Trait for provider configuration types.
All provider configurations must implement this trait to provide consistent validation and construction patterns.
Required Associated Types§
Required Methods§
Sourcefn build(self) -> Result<Self::Provider, ConfigError>
fn build(self) -> Result<Self::Provider, ConfigError>
Build a provider instance from this configuration.
This method should validate the configuration and create a new provider instance. It should fail if the configuration is invalid.
Sourcefn validate(&self) -> Result<(), ConfigError>
fn validate(&self) -> Result<(), ConfigError>
Validate the configuration without building a provider.
This method should check that all required fields are present and that all values are valid.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.