| 184 | } |
| 185 | |
| 186 | fn atomic_enum_load(ident: &Ident) -> TokenStream2 { |
| 187 | quote! { |
| 188 | /// Loads a value from the atomic. |
| 189 | /// |
| 190 | /// `load` takes an `Ordering` argument which describes the memory ordering of this operation. Possible values are `SeqCst`, `Acquire` and `Relaxed`. |
| 191 | /// |
| 192 | /// # Panics |
| 193 | /// |
| 194 | /// Panics if order is `Release` or `AcqRel`. |
| 195 | pub fn load(&self, order: core::sync::atomic::Ordering) -> #ident { |
| 196 | Self::from_usize(self.0.load(order)) |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | |
| 201 | fn atomic_enum_store(ident: &Ident) -> TokenStream2 { |
| 202 | quote! { |