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

Function atomic_enum_get

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

Source from the content-addressed store, hash-verified

160}
161
162fn atomic_enum_get(ident: &Ident) -> TokenStream2 {
163 quote! {
164 /// Gets the value of the atomic without performing an atomic operation.
165 ///
166 /// This is safe because the mutable reference guarantees that no other threads are concurrently accessing the atomic data.
167 pub fn get(&mut self) -> #ident {
168 Self::from_usize(*self.0.get_mut())
169 }
170 }
171}
172
173fn atomic_enum_swap_mut(ident: &Ident) -> TokenStream2 {
174 quote! {

Callers 1

atomic_enumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected