@@ -27,10 +27,10 @@ use {
27
27
/// does not imply any ownership or lifetime; pointers to elements in the array
28
28
/// may not be safe to dereference.
29
29
///
30
- /// ***Note:*** `DataRaw ` is not an extension interface at this point.
30
+ /// ***Note:*** `RawData ` is not an extension interface at this point.
31
31
/// Traits in Rust can serve many different roles. This trait is public because
32
32
/// it is used as a bound on public methods.
33
- pub unsafe trait DataRaw : Sized {
33
+ pub unsafe trait RawData : Sized {
34
34
/// The array element type.
35
35
type Elem ;
36
36
@@ -45,8 +45,8 @@ pub unsafe trait DataRaw : Sized {
45
45
///
46
46
/// For an array with writable elements.
47
47
///
48
- /// ***Internal trait, see `DataRaw `.***
49
- pub unsafe trait DataRawMut : DataRaw {
48
+ /// ***Internal trait, see `RawData `.***
49
+ pub unsafe trait RawDataMut : RawData {
50
50
/// If possible, ensures that the array has unique access to its data.
51
51
///
52
52
/// If `Self` provides safe mutable access to array elements, then it
@@ -68,8 +68,8 @@ pub unsafe trait DataRawMut : DataRaw {
68
68
///
69
69
/// An array representation that can be cloned.
70
70
///
71
- /// ***Internal trait, see `DataRaw `.***
72
- pub unsafe trait DataRawClone : DataRaw {
71
+ /// ***Internal trait, see `RawData `.***
72
+ pub unsafe trait RawDataClone : RawData {
73
73
#[ doc( hidden) ]
74
74
/// Unsafe because, `ptr` must point inside the current storage.
75
75
unsafe fn clone_with_ptr ( & self , ptr : * mut Self :: Elem ) -> ( Self , * mut Self :: Elem ) ;
@@ -86,8 +86,8 @@ pub unsafe trait DataRawClone : DataRaw {
86
86
///
87
87
/// For an array with elements that can be accessed with safe code.
88
88
///
89
- /// ***Internal trait, see `DataRaw `.***
90
- pub unsafe trait Data : DataRaw {
89
+ /// ***Internal trait, see `RawData `.***
90
+ pub unsafe trait Data : RawData {
91
91
/// Converts the array to a uniquely owned array, cloning elements if necessary.
92
92
#[ doc( hidden) ]
93
93
fn into_owned < D > ( self_ : ArrayBase < Self , D > ) -> ArrayBase < OwnedRepr < Self :: Elem > , D >
@@ -105,10 +105,10 @@ pub unsafe trait Data : DataRaw {
105
105
// # For implementers
106
106
//
107
107
// If you implement the `DataMut` trait, you are guaranteeing that the
108
- // `DataRawMut ::try_ensure_unique` implementation always panics or ensures that
108
+ // `RawDataMut ::try_ensure_unique` implementation always panics or ensures that
109
109
// the data is unique. You are also guaranteeing that `try_is_unique` always
110
110
// returns `Some(_)`.
111
- pub unsafe trait DataMut : Data + DataRawMut {
111
+ pub unsafe trait DataMut : Data + RawDataMut {
112
112
/// Ensures that the array has unique access to its data.
113
113
#[ doc( hidden) ]
114
114
#[ inline]
@@ -133,35 +133,35 @@ pub unsafe trait DataMut : Data + DataRawMut {
133
133
/// accessed with safe code.
134
134
///
135
135
/// ***Internal trait, see `Data`.***
136
- #[ deprecated( note="use `Data + DataRawClone ` instead" , since="0.13" ) ]
137
- pub trait DataClone : Data + DataRawClone { }
136
+ #[ deprecated( note="use `Data + RawDataClone ` instead" , since="0.13" ) ]
137
+ pub trait DataClone : Data + RawDataClone { }
138
138
139
139
#[ allow( deprecated) ]
140
- impl < T > DataClone for T where T : Data + DataRawClone { }
140
+ impl < T > DataClone for T where T : Data + RawDataClone { }
141
141
142
- unsafe impl < A > DataRaw for RawViewRepr < * const A > {
142
+ unsafe impl < A > RawData for RawViewRepr < * const A > {
143
143
type Elem = A ;
144
144
fn _data_slice ( & self ) -> Option < & [ A ] > {
145
145
None
146
146
}
147
147
private_impl ! { }
148
148
}
149
149
150
- unsafe impl < A > DataRawClone for RawViewRepr < * const A > {
150
+ unsafe impl < A > RawDataClone for RawViewRepr < * const A > {
151
151
unsafe fn clone_with_ptr ( & self , ptr : * mut Self :: Elem ) -> ( Self , * mut Self :: Elem ) {
152
152
( * self , ptr)
153
153
}
154
154
}
155
155
156
- unsafe impl < A > DataRaw for RawViewRepr < * mut A > {
156
+ unsafe impl < A > RawData for RawViewRepr < * mut A > {
157
157
type Elem = A ;
158
158
fn _data_slice ( & self ) -> Option < & [ A ] > {
159
159
None
160
160
}
161
161
private_impl ! { }
162
162
}
163
163
164
- unsafe impl < A > DataRawMut for RawViewRepr < * mut A > {
164
+ unsafe impl < A > RawDataMut for RawViewRepr < * mut A > {
165
165
#[ inline]
166
166
fn try_ensure_unique < D > ( _: & mut ArrayBase < Self , D > )
167
167
where Self : Sized ,
@@ -174,13 +174,13 @@ unsafe impl<A> DataRawMut for RawViewRepr<*mut A> {
174
174
}
175
175
}
176
176
177
- unsafe impl < A > DataRawClone for RawViewRepr < * mut A > {
177
+ unsafe impl < A > RawDataClone for RawViewRepr < * mut A > {
178
178
unsafe fn clone_with_ptr ( & self , ptr : * mut Self :: Elem ) -> ( Self , * mut Self :: Elem ) {
179
179
( * self , ptr)
180
180
}
181
181
}
182
182
183
- unsafe impl < A > DataRaw for OwnedArcRepr < A > {
183
+ unsafe impl < A > RawData for OwnedArcRepr < A > {
184
184
type Elem = A ;
185
185
fn _data_slice ( & self ) -> Option < & [ A ] > {
186
186
Some ( & self . 0 )
@@ -189,7 +189,7 @@ unsafe impl<A> DataRaw for OwnedArcRepr<A> {
189
189
}
190
190
191
191
// NOTE: Copy on write
192
- unsafe impl < A > DataRawMut for OwnedArcRepr < A >
192
+ unsafe impl < A > RawDataMut for OwnedArcRepr < A >
193
193
where
194
194
A : Clone ,
195
195
{
@@ -246,22 +246,22 @@ unsafe impl<A> Data for OwnedArcRepr<A> {
246
246
247
247
unsafe impl < A > DataMut for OwnedArcRepr < A > where A : Clone { }
248
248
249
- unsafe impl < A > DataRawClone for OwnedArcRepr < A > {
249
+ unsafe impl < A > RawDataClone for OwnedArcRepr < A > {
250
250
unsafe fn clone_with_ptr ( & self , ptr : * mut Self :: Elem ) -> ( Self , * mut Self :: Elem ) {
251
251
// pointer is preserved
252
252
( self . clone ( ) , ptr)
253
253
}
254
254
}
255
255
256
- unsafe impl < A > DataRaw for OwnedRepr < A > {
256
+ unsafe impl < A > RawData for OwnedRepr < A > {
257
257
type Elem = A ;
258
258
fn _data_slice ( & self ) -> Option < & [ A ] > {
259
259
Some ( & self . 0 )
260
260
}
261
261
private_impl ! { }
262
262
}
263
263
264
- unsafe impl < A > DataRawMut for OwnedRepr < A > {
264
+ unsafe impl < A > RawDataMut for OwnedRepr < A > {
265
265
#[ inline]
266
266
fn try_ensure_unique < D > ( _: & mut ArrayBase < Self , D > )
267
267
where Self : Sized ,
@@ -287,7 +287,7 @@ unsafe impl<A> Data for OwnedRepr<A> {
287
287
288
288
unsafe impl < A > DataMut for OwnedRepr < A > { }
289
289
290
- unsafe impl < A > DataRawClone for OwnedRepr < A >
290
+ unsafe impl < A > RawDataClone for OwnedRepr < A >
291
291
where A : Clone
292
292
{
293
293
unsafe fn clone_with_ptr ( & self , ptr : * mut Self :: Elem ) -> ( Self , * mut Self :: Elem ) {
@@ -313,7 +313,7 @@ unsafe impl<A> DataRawClone for OwnedRepr<A>
313
313
}
314
314
}
315
315
316
- unsafe impl < ' a , A > DataRaw for ViewRepr < & ' a A > {
316
+ unsafe impl < ' a , A > RawData for ViewRepr < & ' a A > {
317
317
type Elem = A ;
318
318
fn _data_slice ( & self ) -> Option < & [ A ] > {
319
319
None
@@ -331,21 +331,21 @@ unsafe impl<'a, A> Data for ViewRepr<&'a A> {
331
331
}
332
332
}
333
333
334
- unsafe impl < ' a , A > DataRawClone for ViewRepr < & ' a A > {
334
+ unsafe impl < ' a , A > RawDataClone for ViewRepr < & ' a A > {
335
335
unsafe fn clone_with_ptr ( & self , ptr : * mut Self :: Elem ) -> ( Self , * mut Self :: Elem ) {
336
336
( * self , ptr)
337
337
}
338
338
}
339
339
340
- unsafe impl < ' a , A > DataRaw for ViewRepr < & ' a mut A > {
340
+ unsafe impl < ' a , A > RawData for ViewRepr < & ' a mut A > {
341
341
type Elem = A ;
342
342
fn _data_slice ( & self ) -> Option < & [ A ] > {
343
343
None
344
344
}
345
345
private_impl ! { }
346
346
}
347
347
348
- unsafe impl < ' a , A > DataRawMut for ViewRepr < & ' a mut A > {
348
+ unsafe impl < ' a , A > RawDataMut for ViewRepr < & ' a mut A > {
349
349
#[ inline]
350
350
fn try_ensure_unique < D > ( _: & mut ArrayBase < Self , D > )
351
351
where Self : Sized ,
@@ -389,7 +389,7 @@ pub unsafe trait DataOwned : Data {
389
389
/// A representation that is a lightweight view.
390
390
///
391
391
/// ***Internal trait, see `Data`.***
392
- pub unsafe trait DataShared : Clone + Data + DataRawClone { }
392
+ pub unsafe trait DataShared : Clone + Data + RawDataClone { }
393
393
394
394
unsafe impl < A > DataShared for OwnedRcRepr < A > { }
395
395
unsafe impl < ' a , A > DataShared for ViewRepr < & ' a A > { }
0 commit comments