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

Function atomic_enum_set

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

Source from the content-addressed store, hash-verified

149}
150
151fn 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
162fn atomic_enum_get(ident: &Ident) -> TokenStream2 {
163 quote! {

Callers 1

atomic_enumFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected