Find the value of the kernel argument with the provided name, which must be present. Otherwise the same as [`Self::value_of`].
(&'a self, key: &T)
| 195 | /// |
| 196 | /// Otherwise the same as [`Self::value_of`]. |
| 197 | pub fn require_value_of<T: AsRef<[u8]> + ?Sized>(&'a self, key: &T) -> Result<&'a [u8]> { |
| 198 | let key = key.as_ref(); |
| 199 | self.value_of(key).ok_or_else(|| { |
| 200 | let key = String::from_utf8_lossy(key); |
| 201 | anyhow::anyhow!("Failed to find kernel argument '{key}'") |
| 202 | }) |
| 203 | } |
| 204 | |
| 205 | /// Add a parameter to the command line if it doesn't already exist |
| 206 | /// |