How do you import and reference enum types from the Rust std lib?
I\'m trying to use the Ordering enum from the std::sync::atomics module.
Ordering
std::sync::atomics
As of Rust 1.0, enum variants are scoped inside of their enum type. They can be directly used:
use
pub use self::Foo::{A, B}; pub enum Foo { A, B, } fn main() { let a = A; }
or you can use the type-qualified name:
pub enum Foo { A, B, } fn main() { let a = Foo::A; }