Queries the value of the keyed `flag` from the specification, which may or may not be present. The value is parsed according to the type `V`. The flag is marked as "checked" so that `finish` won't raise it as residual.
(&mut self, key: &str)
| 166 | /// |
| 167 | /// The flag is marked as "checked" so that `finish` won't raise it as residual. |
| 168 | pub fn take_keyed_flag<V>(&mut self, key: &str) -> Result<Option<V>> |
| 169 | where |
| 170 | V: FromStr, |
| 171 | V::Err: Display, |
| 172 | { |
| 173 | match self.take_keyed_flag_str(key) { |
| 174 | Some(v) => V::from_str(v) |
| 175 | .map(|v| Some(v)) |
| 176 | .map_err(|e| mkerror!("Invalid console flag {}: {}", key, e)), |
| 177 | None => Ok(None), |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | /// Validates that all provided flags have been queried by the driver. |
| 182 | pub fn finish(self) -> Result<()> { |
no test coverage detected