MCPcopy Create free account
hub / github.com/clockworklabs/SpacetimeDB / validate

Method validate

crates/cli/src/spacetime_config.rs:770–782  ·  view source on GitHub ↗

Validate that all required keys are present in either config or CLI.

(&self)

Source from the content-addressed store, hash-verified

768
769 /// Validate that all required keys are present in either config or CLI.
770 pub fn validate(&self) -> Result<(), CommandConfigError> {
771 for key in &self.schema.keys {
772 if key.is_required()
773 && !self.config_values.contains_key(key.config_name())
774 && !self.schema.is_from_cli(self.matches, key.config_name())
775 {
776 return Err(CommandConfigError::MissingRequiredKey {
777 key: key.config_name().to_string(),
778 });
779 }
780 }
781 Ok(())
782 }
783}
784
785impl SpacetimeConfig {

Calls 7

is_requiredMethod · 0.80
contains_keyMethod · 0.80
config_nameMethod · 0.80
is_from_cliMethod · 0.80
ErrFunction · 0.50
OkFunction · 0.50
to_stringMethod · 0.45

Tested by 1