MCPcopy Create free account
hub / github.com/Lymia/enumset / try_as_enumset

Method try_as_enumset

enumset/src/impl_set_mixed.rs:271–277  ·  view source on GitHub ↗

Attempts to convert this set into the corresponding [`EnumSet`]. If any unknown bits are present in the set, this method will return `None`.

(&self)

Source from the content-addressed store, hash-verified

269 ///
270 /// If any unknown bits are present in the set, this method will return `None`.
271 pub fn try_as_enumset(&self) -> Option<EnumSet<T>> {
272 if self.has_unknown_bits() {
273 None
274 } else {
275 Some(EnumSet { repr: self.repr })
276 }
277 }
278
279 /// Converts this set into the corresponding [`EnumSet`], ignoring bits that do not correspond
280 /// to a variant.

Callers 1

as_enumsetMethod · 0.80

Calls 1

has_unknown_bitsMethod · 0.80

Tested by

no test coverage detected