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

Function atomic_enum_load

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

Source from the content-addressed store, hash-verified

184}
185
186fn 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
201fn atomic_enum_store(ident: &Ident) -> TokenStream2 {
202 quote! {

Callers 1

atomic_enumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected