File tree Expand file tree Collapse file tree 1 file changed +18
-7
lines changed
Expand file tree Collapse file tree 1 file changed +18
-7
lines changed Original file line number Diff line number Diff line change @@ -91,6 +91,17 @@ use unordered_copy::*;
9191
9292use crate :: private:: Sealed ;
9393
94+ /// Public trait for allowing users of the library to name the types that can
95+ /// be natively stored in racy memory. These are effectively the unsigned
96+ /// integers from 1 to 8 bytes in size.
97+ pub trait RacyStorage : Sealed { }
98+
99+ impl RacyStorage for u8 { }
100+ impl RacyStorage for u16 { }
101+ impl RacyStorage for u32 { }
102+ impl RacyStorage for u64 { }
103+ impl RacyStorage for usize { }
104+
94105/// ECMAScript atomic memory orderings
95106///
96107/// Memory orderings specify the way atomic operations synchronise memory.
@@ -308,14 +319,14 @@ impl<T: Sealed> RacyMemory<T> {
308319}
309320
310321mod private {
311- pub trait Sealed : Copy + core:: fmt:: Debug { }
312- }
322+ pub trait Sealed : Copy + Eq + Send + Sync + core:: fmt:: Display { }
313323
314- impl Sealed for u8 { }
315- impl Sealed for u16 { }
316- impl Sealed for u32 { }
317- impl Sealed for u64 { }
318- impl Sealed for usize { }
324+ impl Sealed for u8 { }
325+ impl Sealed for u16 { }
326+ impl Sealed for u32 { }
327+ impl Sealed for u64 { }
328+ impl Sealed for usize { }
329+ }
319330
320331/// Opaque handle to a slice of memory with the ECMAScript Atomics memory
321332/// model.
You can’t perform that action at this time.
0 commit comments