https://docs.rs/atomic_enum/latest/atomic_enum/
#[atomic_enum]
#[derive(PartialEq)]
enum CatState {
Dead = 0,
BothDeadAndAlive,
Alive,
}
let state = AtomicCatState::new(CatState::Dead);
state.store(CatState::Alive, Ordering::Relaxed);
assert_eq!(state.load(Ordering::Relaxed), CatState::Alive);
标签:enum,Ordering,CatState,Alive,state,atomic,rust From: https://www.cnblogs.com/itfanr/p/17468263.html