pub struct ServiceConfig {
pub strategy: Option<Strategy>,
pub rule_sets_file_paths: Option<Vec<String>>,
pub rule_sets: Vec<RuleSet>,
pub middlewares_file_paths: Option<Vec<String>>,
pub fallback_respond_dir: String,
}Fields§
§strategy: Option<Strategy>How multiple matching rules in a set are resolved. Currently
first_match is the only recognised value.
rule_sets_file_paths: Option<Vec<String>>Paths to rule-set TOML files. User-editable via the [service]
table.
rule_sets: Vec<RuleSet>Loaded rule sets in the same order as rule_sets_file_paths.
Populated at startup by Config::new (this field is
#[serde(skip)] because it comes from loading the files listed
above, not from the config TOML itself).
middlewares_file_paths: Option<Vec<String>>Paths to Rhai middleware files. Compilation happens in the server crate — config only holds the paths.
fallback_respond_dir: StringFilesystem directory served by the dyn-route fallback.
Implementations§
Source§impl ServiceConfig
impl ServiceConfig
Sourcepub fn validate(&self) -> bool
pub fn validate(&self) -> bool
Validate that every rule set and the fallback respond dir are internally consistent.
§Why validation stays in config, not routing
Validation inspects cross-cutting state (file existence of the fallback dir, every rule’s respond.file_path, etc.). All that state is assembled by config loading. Routing has per-rule validators, which this method calls.
Trait Implementations§
Source§impl Clone for ServiceConfig
impl Clone for ServiceConfig
Source§fn clone(&self) -> ServiceConfig
fn clone(&self) -> ServiceConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more