@@ -5,7 +5,7 @@ use core::marker::PhantomData;
5
5
6
6
/// A mask where each lane is represented by a single bit.
7
7
#[ repr( transparent) ]
8
- pub struct Mask < T , const N : usize > (
8
+ pub ( crate ) struct Mask < T , const N : usize > (
9
9
<LaneCount < N > as SupportedLaneCount >:: BitMask ,
10
10
PhantomData < T > ,
11
11
)
78
78
{
79
79
#[ inline]
80
80
#[ must_use = "method returns a new mask and does not mutate the original value" ]
81
- pub fn splat ( value : bool ) -> Self {
81
+ pub ( crate ) fn splat ( value : bool ) -> Self {
82
82
let mut mask = <LaneCount < N > as SupportedLaneCount >:: BitMask :: default ( ) ;
83
83
if value {
84
84
mask. as_mut ( ) . fill ( u8:: MAX )
@@ -93,20 +93,20 @@ where
93
93
94
94
#[ inline]
95
95
#[ must_use = "method returns a new bool and does not mutate the original value" ]
96
- pub unsafe fn test_unchecked ( & self , lane : usize ) -> bool {
96
+ pub ( crate ) unsafe fn test_unchecked ( & self , lane : usize ) -> bool {
97
97
( self . 0 . as_ref ( ) [ lane / 8 ] >> ( lane % 8 ) ) & 0x1 > 0
98
98
}
99
99
100
100
#[ inline]
101
- pub unsafe fn set_unchecked ( & mut self , lane : usize , value : bool ) {
101
+ pub ( crate ) unsafe fn set_unchecked ( & mut self , lane : usize , value : bool ) {
102
102
unsafe {
103
103
self . 0 . as_mut ( ) [ lane / 8 ] ^= ( ( value ^ self . test_unchecked ( lane) ) as u8 ) << ( lane % 8 )
104
104
}
105
105
}
106
106
107
107
#[ inline]
108
108
#[ must_use = "method returns a new vector and does not mutate the original value" ]
109
- pub fn to_int ( self ) -> Simd < T , N > {
109
+ pub ( crate ) fn to_int ( self ) -> Simd < T , N > {
110
110
unsafe {
111
111
core:: intrinsics:: simd:: simd_select_bitmask (
112
112
self . 0 ,
@@ -118,19 +118,19 @@ where
118
118
119
119
#[ inline]
120
120
#[ must_use = "method returns a new mask and does not mutate the original value" ]
121
- pub unsafe fn from_int_unchecked ( value : Simd < T , N > ) -> Self {
121
+ pub ( crate ) unsafe fn from_int_unchecked ( value : Simd < T , N > ) -> Self {
122
122
unsafe { Self ( core:: intrinsics:: simd:: simd_bitmask ( value) , PhantomData ) }
123
123
}
124
124
125
125
#[ inline]
126
- pub fn to_bitmask_integer ( self ) -> u64 {
126
+ pub ( crate ) fn to_bitmask_integer ( self ) -> u64 {
127
127
let mut bitmask = [ 0u8 ; 8 ] ;
128
128
bitmask[ ..self . 0 . as_ref ( ) . len ( ) ] . copy_from_slice ( self . 0 . as_ref ( ) ) ;
129
129
u64:: from_ne_bytes ( bitmask)
130
130
}
131
131
132
132
#[ inline]
133
- pub fn from_bitmask_integer ( bitmask : u64 ) -> Self {
133
+ pub ( crate ) fn from_bitmask_integer ( bitmask : u64 ) -> Self {
134
134
let mut bytes = <LaneCount < N > as SupportedLaneCount >:: BitMask :: default ( ) ;
135
135
let len = bytes. as_mut ( ) . len ( ) ;
136
136
bytes
@@ -141,7 +141,7 @@ where
141
141
142
142
#[ inline]
143
143
#[ must_use = "method returns a new mask and does not mutate the original value" ]
144
- pub fn convert < U > ( self ) -> Mask < U , N >
144
+ pub ( crate ) fn convert < U > ( self ) -> Mask < U , N >
145
145
where
146
146
U : MaskElement ,
147
147
{
@@ -151,13 +151,13 @@ where
151
151
152
152
#[ inline]
153
153
#[ must_use = "method returns a new bool and does not mutate the original value" ]
154
- pub fn any ( self ) -> bool {
154
+ pub ( crate ) fn any ( self ) -> bool {
155
155
self != Self :: splat ( false )
156
156
}
157
157
158
158
#[ inline]
159
159
#[ must_use = "method returns a new bool and does not mutate the original value" ]
160
- pub fn all ( self ) -> bool {
160
+ pub ( crate ) fn all ( self ) -> bool {
161
161
self == Self :: splat ( true )
162
162
}
163
163
}
0 commit comments