MCPcopy Create free account
hub / github.com/cloud-hypervisor/cloud-hypervisor / get

Method get

option_parser/src/lib.rs:244–255  ·  view source on GitHub ↗

Returns the raw string value of an option, or `None` if the option was not set or if its value is an empty string (e.g. `key=`). Surrounding double-quotes in the value are removed.

(&self, option: &str)

Source from the content-addressed store, hash-verified

242 ///
243 /// Surrounding double-quotes in the value are removed.
244 pub fn get(&self, option: &str) -> Option<String> {
245 self.options
246 .get(option)
247 .and_then(|v| v.value.clone())
248 .and_then(|s| {
249 if s.is_empty() {
250 None
251 } else {
252 Some(dequote(&s))
253 }
254 })
255 }
256
257 /// Returns `true` if the option was present in the parsed input.
258 ///

Callers 2

is_setMethod · 0.45
convertMethod · 0.45

Calls 3

dequoteFunction · 0.85
cloneMethod · 0.45
is_emptyMethod · 0.45

Tested by

no test coverage detected