MCPcopy Create free account
hub / github.com/brain0/atomic_enum / atomic_enum_store

Function atomic_enum_store

src/lib.rs:201–214  ·  view source on GitHub ↗
(ident: &Ident)

Source from the content-addressed store, hash-verified

199}
200
201fn atomic_enum_store(ident: &Ident) -> TokenStream2 {
202 quote! {
203 /// Stores a value into the atomic.
204 ///
205 /// `store` takes an `Ordering` argument which describes the memory ordering of this operation. Possible values are `SeqCst`, `Release` and `Relaxed`.
206 ///
207 /// # Panics
208 ///
209 /// Panics if order is `Acquire` or `AcqRel`.
210 pub fn store(&self, val: #ident, order: core::sync::atomic::Ordering) {
211 self.0.store(Self::to_usize(val), order)
212 }
213 }
214}
215
216#[cfg(feature = "cas")]
217fn atomic_enum_swap(ident: &Ident) -> TokenStream2 {

Callers 1

atomic_enumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected