memacc/bitman/unchecked/read/
are_bits_high_scattered.rs1use crate::bitman::IsBitLow;
2
3pub trait AreBitsHighScattered {
5 type Type;
7
8 fn are_bits_high_scattered(&self, indices: &[Self::Type]) -> bool;
10}
11
12macro_rules! ImplementAreBitsHighScattered {
14 ($type:ty) => {
15 impl AreBitsHighScattered for $type {
16 type Type = Self;
17 #[inline]
18 #[must_use]
19 fn are_bits_high_scattered(&self, indices: &[Self::Type]) -> bool {
20 for index in indices {
21 if self.is_bit_low(*index) {
22 return false;
23 }
24 }
25 true
26 }
27 }
28 };
29}
30
31ImplementAreBitsHighScattered!(u8);
32ImplementAreBitsHighScattered!(u32);
33ImplementAreBitsHighScattered!(u64);
34
35