atomic_enum rust 原子枚举类型
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);
转载请注明原文链接:https://www.cnblogs.com/itfanr/p/17468263.html
公众号:小弧光黑板报