Locate a kernel argument with the given key name. Returns an error if a parameter with the given key name is found, but the value is not valid UTF-8. Otherwise, returns the first parameter matching the given key, or `None` if not found. Key comparison treats dashes and underscores as equivalent.
(
&'a self,
key: &T,
)
| 161 | /// or `None` if not found. Key comparison treats dashes and |
| 162 | /// underscores as equivalent. |
| 163 | pub fn find_utf8<T: AsRef<[u8]> + ?Sized>( |
| 164 | &'a self, |
| 165 | key: &T, |
| 166 | ) -> Result<Option<utf8::Parameter<'a>>> { |
| 167 | let bytes = match self.find(key.as_ref()) { |
| 168 | Some(p) => p, |
| 169 | None => return Ok(None), |
| 170 | }; |
| 171 | |
| 172 | Ok(Some(utf8::Parameter::try_from(bytes)?)) |
| 173 | } |
| 174 | |
| 175 | /// Find all kernel arguments starting with the given prefix. |
| 176 | /// |