Skip to main content

get

Function get 

Source
pub fn get<T>() -> &'static T
where T: 'static + Zeroable,
Expand description

Generic static in the DefaultNamespace.

use core::sync::atomic::{AtomicU32, Ordering};

let a = static_generics::get::<AtomicU32>();
a.store(7, Ordering::Relaxed);
assert_eq!(static_generics::get::<AtomicU32>().load(Ordering::Relaxed), 7);