MCPcopy Create free account
hub / github.com/NodeDB-Lab/nodedb / required

Function required

nodedb/src/ctl/args.rs:61–65  ·  view source on GitHub ↗

Require a flag and return its value, or produce a uniform error.

(flags: &'a HashMap<String, String>, name: &str)

Source from the content-addressed store, hash-verified

59
60/// Require a flag and return its value, or produce a uniform error.
61pub fn required<'a>(flags: &'a HashMap<String, String>, name: &str) -> Result<&'a String, String> {
62 flags
63 .get(name)
64 .ok_or_else(|| format!("missing required flag --{name}"))
65}
66
67/// Parse a human-friendly duration string (`10s`, `5m`, `2h`). No
68/// fractional units. Used by `--ttl`.

Callers 15

add_columnMethod · 0.85
column_def_displayFunction · 0.85
new_bitemporalMethod · 0.85
build_strict_schemaFunction · 0.85
build_kv_collection_typeFunction · 0.85
build_schema_bytesFunction · 0.85
parse_column_defsFunction · 0.85
parse_origin_column_defFunction · 0.85
infer_schema_from_valueFunction · 0.85
ts_schema_to_sharedFunction · 0.85

Calls 1

getMethod · 0.45