(ident: &Ident)
| 149 | } |
| 150 | |
| 151 | fn atomic_enum_set(ident: &Ident) -> TokenStream2 { |
| 152 | quote! { |
| 153 | /// Sets the value of the atomic without performing an atomic operation. |
| 154 | /// |
| 155 | /// This is safe because the mutable reference guarantees that no other threads are concurrently accessing the atomic data. |
| 156 | pub fn set(&mut self, v: #ident) { |
| 157 | *self.0.get_mut() = Self::to_usize(v); |
| 158 | } |
| 159 | } |
| 160 | } |
| 161 | |
| 162 | fn atomic_enum_get(ident: &Ident) -> TokenStream2 { |
| 163 | quote! { |