1 | mod all; |
---|---|

2 | mod bits; |

3 | mod complement; |

4 | mod contains; |

5 | mod difference; |

6 | mod empty; |

7 | mod eq; |

8 | mod extend; |

9 | mod flags; |

10 | mod fmt; |

11 | mod from_bits; |

12 | mod from_bits_retain; |

13 | mod from_bits_truncate; |

14 | mod from_name; |

15 | mod insert; |

16 | mod intersection; |

17 | mod intersects; |

18 | mod is_all; |

19 | mod is_empty; |

20 | mod iter; |

21 | mod parser; |

22 | mod remove; |

23 | mod symmetric_difference; |

24 | mod union; |

25 | |

26 | bitflags! { |

27 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

28 | pub struct TestFlags: u8 { |

29 | /// 1 |

30 | const A = 1; |

31 | |

32 | /// 1 << 1 |

33 | const B = 1 << 1; |

34 | |

35 | /// 1 << 2 |

36 | const C = 1 << 2; |

37 | |

38 | /// 1 | (1 << 1) | (1 << 2) |

39 | const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); |

40 | } |

41 | |

42 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

43 | pub struct TestFlagsInvert: u8 { |

44 | /// 1 | (1 << 1) | (1 << 2) |

45 | const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); |

46 | |

47 | /// 1 |

48 | const A = 1; |

49 | |

50 | /// 1 << 1 |

51 | const B = 1 << 1; |

52 | |

53 | /// 1 << 2 |

54 | const C = 1 << 2; |

55 | } |

56 | |

57 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

58 | pub struct TestZero: u8 { |

59 | /// 0 |

60 | const ZERO = 0; |

61 | } |

62 | |

63 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

64 | pub struct TestZeroOne: u8 { |

65 | /// 0 |

66 | const ZERO = 0; |

67 | |

68 | /// 1 |

69 | const ONE = 1; |

70 | } |

71 | |

72 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

73 | pub struct TestUnicode: u8 { |

74 | /// 1 |

75 | const 一 = 1; |

76 | |

77 | /// 2 |

78 | const 二 = 1 << 1; |

79 | } |

80 | |

81 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

82 | pub struct TestEmpty: u8 {} |

83 | |

84 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

85 | pub struct TestOverlapping: u8 { |

86 | /// 1 | (1 << 1) |

87 | const AB = 1 | (1 << 1); |

88 | |

89 | /// (1 << 1) | (1 << 2) |

90 | const BC = (1 << 1) | (1 << 2); |

91 | } |

92 | |

93 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

94 | pub struct TestOverlappingFull: u8 { |

95 | /// 1 |

96 | const A = 1; |

97 | |

98 | /// 1 |

99 | const B = 1; |

100 | |

101 | /// 1 |

102 | const C = 1; |

103 | |

104 | /// 2 |

105 | const D = 1 << 1; |

106 | } |

107 | |

108 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

109 | pub struct TestExternal: u8 { |

110 | /// 1 |

111 | const A = 1; |

112 | |

113 | /// 1 << 1 |

114 | const B = 1 << 1; |

115 | |

116 | /// 1 << 2 |

117 | const C = 1 << 2; |

118 | |

119 | /// 1 | (1 << 1) | (1 << 2) |

120 | const ABC = Self::A.bits() | Self::B.bits() | Self::C.bits(); |

121 | |

122 | /// External |

123 | const _ = !0; |

124 | } |

125 | |

126 | #[derive(Debug, PartialEq, Eq, PartialOrd, Ord, Clone, Copy)] |

127 | pub struct TestExternalFull: u8 { |

128 | /// External |

129 | const _ = !0; |

130 | } |

131 | } |

132 |