Get a flags value with the bits of a flag with the given name set. This method will return `None` if `name` is empty or doesn't correspond to any named flag.
(name: &str)
| 210 | /// This method will return `None` if `name` is empty or doesn't |
| 211 | /// correspond to any named flag. |
| 212 | fn from_name(name: &str) -> Option<Self> { |
| 213 | // Don't parse empty names as empty flags |
| 214 | if name.is_empty() { |
| 215 | return None; |
| 216 | } |
| 217 | |
| 218 | for flag in Self::FLAGS { |
| 219 | if flag.name() == name { |
| 220 | return Some(Self::from_bits_retain(flag.value().bits())); |
| 221 | } |
| 222 | } |
| 223 | |
| 224 | None |
| 225 | } |
| 226 | |
| 227 | /// Yield a set of contained flags values. |
| 228 | /// |
nothing calls this directly
no test coverage detected