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

Function read_table

crates/cli/src/config.rs:65–79  ·  view source on GitHub ↗
(table: &'a toml_edit::Table, key: &'a str)

Source from the content-addressed store, hash-verified

63}
64
65fn read_table<'a>(table: &'a toml_edit::Table, key: &'a str) -> Result<Option<&'a ArrayOfTables>, CliError> {
66 if let Some(value) = table.get(key) {
67 if value.is_array_of_tables() {
68 Ok(value.as_array_of_tables())
69 } else {
70 Err(CliError::ConfigType {
71 key: key.to_string(),
72 kind: "table array",
73 found: Box::new(value.clone()),
74 })
75 }
76 } else {
77 Ok(None)
78 }
79}
80
81fn read_opt_str(table: &toml_edit::Table, key: &str) -> Result<Option<String>, CliError> {
82 if let Some(value) = table.get(key) {

Callers 1

try_fromMethod · 0.85

Calls 6

OkFunction · 0.50
ErrFunction · 0.50
newFunction · 0.50
getMethod · 0.45
to_stringMethod · 0.45
cloneMethod · 0.45

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…