MCPcopy Create free account
hub / github.com/base/base / config_component

Method config_component

etc/systems/src/benchmark_cli.rs:867–882  ·  view source on GitHub ↗

Reads a string or numeric `testConfig` field as a stable identity component.

(run: &VisualizerRun, key: &str)

Source from the content-addressed store, hash-verified

865
866 /// Reads a string or numeric `testConfig` field as a stable identity component.
867 fn config_component(run: &VisualizerRun, key: &str) -> Result<String> {
868 let value = run
869 .test_config
870 .get(key)
871 .ok_or_else(|| eyre::eyre!("run {} is missing testConfig.{key}", run.id))?;
872 if let Some(text) = value.as_str() {
873 return Ok(text.to_owned());
874 }
875 if let Some(number) = value.as_i64() {
876 return Ok(number.to_string());
877 }
878 if let Some(number) = value.as_u64() {
879 return Ok(number.to_string());
880 }
881 Err(eyre::eyre!("run {} testConfig.{key} is not a string or number", run.id))
882 }
883
884 fn page_component(value: &str) -> String {
885 value

Callers

nothing calls this directly

Calls 2

getMethod · 0.45
as_strMethod · 0.45

Tested by

no test coverage detected