How do you import and reference enum types in Rust?

前端 未结 2 619
耶瑟儿~
耶瑟儿~ 2020-12-19 02:30

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.

2条回答
  •  攒了一身酷
    2020-12-19 02:44

    Editor's note: This answer predates Rust 1.0 and is not applicable for Rust 1.0.

    Enum variants are not scoped inside the enum; they are thus std::sync::atomics::Relaxed, &c.

    Scoped enum variants is the subject of issue 10090.

提交回复
热议问题