Returns the state of the given flag in this set. If the given flag is in the set but is negated, then `Some(false)` is returned. If the given flag is in the set and is not negated, then `Some(true)` is returned. Otherwise, `None` is returned.
(&self, flag: Flag)
| 1300 | /// |
| 1301 | /// Otherwise, `None` is returned. |
| 1302 | pub fn flag_state(&self, flag: Flag) -> Option<bool> { |
| 1303 | let mut negated = false; |
| 1304 | for x in &self.items { |
| 1305 | match x.kind { |
| 1306 | FlagsItemKind::Negation => { |
| 1307 | negated = true; |
| 1308 | } |
| 1309 | FlagsItemKind::Flag(ref xflag) if xflag == &flag => { |
| 1310 | return Some(!negated); |
| 1311 | } |
| 1312 | _ => {} |
| 1313 | } |
| 1314 | } |
| 1315 | None |
| 1316 | } |
| 1317 | } |
| 1318 | |
| 1319 | /// A single item in a group of flags. |