MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / iter_scalars

Method iter_scalars

cranelift/bitset/src/compound.rs:547–553  ·  view source on GitHub ↗

Returns an iterator over the words of this bit-set or the in-memory representation of the bit set. # Example ``` use cranelift_bitset::{CompoundBitSet, ScalarBitSet}; let mut bitset = CompoundBitSet:: ::default(); assert_eq!( bitset.iter_scalars().collect:: >(), [], ); bitset.insert(0); assert_eq!( bitset.iter_scalars().collect:: >(), [ScalarBitSet(0x1)], ); bitset.insert(1)

(&self)

Source from the content-addressed store, hash-verified

545 /// );
546 /// ```
547 pub fn iter_scalars(&self) -> impl Iterator<Item = ScalarBitSet<T>> + '_ {
548 let nwords = match self.max {
549 Some(n) => 1 + (n as usize / Self::BITS_PER_SCALAR),
550 None => 0,
551 };
552 self.elems.iter().copied().take(nwords)
553 }
554}
555
556impl<'a, T: ScalarBitSetStorage> IntoIterator for &'a CompoundBitSet<T> {

Callers 1

pushMethod · 0.80

Calls 3

copiedMethod · 0.80
takeMethod · 0.45
iterMethod · 0.45

Tested by

no test coverage detected