reinhardt-conf 0.3.2

Configuration management framework for Reinhardt - Django-inspired settings with encryption and secrets management
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use reinhardt_core::exception::Result;

/// Common configuration trait
///
/// Various `*Config` structures implement this trait to provide
/// a common interface for validation and merging.
pub trait Config: Clone + Send + Sync + 'static {
	/// Validates configuration values. Returns `Error::Validation` if there are problems.
	fn validate(&self) -> Result<()> {
		Ok(())
	}

	/// Merges another configuration with override rules.
	/// Default implementation uses last-wins semantics (`other` takes precedence).
	fn merge(self, other: Self) -> Self {
		other
	}
}