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

Method variant_map

enumset_derive/src/plan.rs:380–390  ·  view source on GitHub ↗

Returns a bitmask of all variants in the set.

(&self)

Source from the content-addressed store, hash-verified

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<()> {

Callers 1

generate_codeFunction · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected