pub struct Config {
pub metadata: Metadata,
pub chains: Vec<ChainConfig>,
pub invariants: Vec<InvariantConfig>,
pub alert: AlertConfig,
pub evaluation: EvaluationConfig,
pub daemon: DaemonConfig,
pub logging: LoggingConfig,
pub metrics: MetricsConfig,
pub security: SecurityConfig,
pub performance: PerformanceConfig,
}Expand description
Root configuration structure.
Fields§
§metadata: MetadataMetadata: name, version, description.
chains: Vec<ChainConfig>Chain endpoints and configuration.
invariants: Vec<InvariantConfig>Invariant definitions.
alert: AlertConfigAlert routing and filtering.
evaluation: EvaluationConfigEvaluation parameters.
daemon: DaemonConfigDaemon mode settings.
logging: LoggingConfigLogging configuration.
metrics: MetricsConfigMetrics / observability.
security: SecurityConfigSecurity settings.
performance: PerformanceConfigPerformance tuning.
Implementations§
Source§impl Config
impl Config
Sourcepub fn load_from_file(path: &str) -> Result<Self>
pub fn load_from_file(path: &str) -> Result<Self>
Load configuration from a TOML file.
Environment variables in the format ${VAR_NAME} are expanded.
§Errors
Returns error if file cannot be read, TOML is invalid, or env var is missing.
Sourcepub fn load_from_string(content: &str) -> Result<Self>
pub fn load_from_string(content: &str) -> Result<Self>
Load configuration from a TOML string.
Environment variables in the format ${VAR_NAME} are expanded.
Sourcepub fn validate(&self) -> Result<(), ConfigError>
pub fn validate(&self) -> Result<(), ConfigError>
Validate the configuration for consistency.
Sourcepub fn get_chain(&self, id: &str) -> Option<&ChainConfig>
pub fn get_chain(&self, id: &str) -> Option<&ChainConfig>
Get a chain configuration by ID.
Sourcepub fn invariants_for_chain(&self, chain_id: &str) -> Vec<&InvariantConfig>
pub fn invariants_for_chain(&self, chain_id: &str) -> Vec<&InvariantConfig>
Get invariants for a specific chain.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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