Returns a bitmask of all variants in the set.
(&self)
| 378 | |
| 379 | /// Returns a bitmask of all variants in the set. |
| 380 | pub fn variant_map(&self) -> Vec<u64> { |
| 381 | let mut vec = vec![0]; |
| 382 | for variant in &self.variants { |
| 383 | let (idx, bit) = (variant.variant_bit as usize / 64, variant.variant_bit % 64); |
| 384 | while idx >= vec.len() { |
| 385 | vec.push(0); |
| 386 | } |
| 387 | vec[idx] |= 1u64 << bit; |
| 388 | } |
| 389 | vec |
| 390 | } |
| 391 | |
| 392 | /// Maps the enum variants as a LSB set. |
| 393 | fn map_lsb(&mut self) -> syn::Result<()> { |