MCPcopy Create free account
hub / github.com/bootc-dev/bootc / value_of

Method value_of

crates/kernel_cmdline/src/bytes.rs:190–192  ·  view source on GitHub ↗

Locate the value of the kernel argument with the given key name. Returns the first value matching the given key, or `None` if not found. Key comparison treats dashes and underscores as equivalent.

(&'a self, key: &T)

Source from the content-addressed store, hash-verified

188 /// Returns the first value matching the given key, or `None` if not found.
189 /// Key comparison treats dashes and underscores as equivalent.
190 pub fn value_of<T: AsRef<[u8]> + ?Sized>(&'a self, key: &T) -> Option<&'a [u8]> {
191 self.find(&key).and_then(|p| p.value)
192 }
193
194 /// Find the value of the kernel argument with the provided name, which must be present.
195 ///

Callers 1

require_value_ofMethod · 0.45

Calls 1

findMethod · 0.45

Tested by

no test coverage detected