RustでC列挙型をラップすることは可能ですか?
たとえば、C列挙型の例
はい、変更なし (一般的な Rust スタイルに適合する空白以外):
enum List {
MaxLogLevel = 1,
MaxNumMessages,
TrilinearFiltering,
MaxAnisotropy,
TexCompression,
SRGBLinearization,
LoadTextures,
FastAnimation,
ShadowMapSize,
SampleCount,
WireframeMode,
DebugViewMode,
DumpFailedShaders,
GatherTimeStats
}
fn main() {
println!("{} {} {}",
MaxLogLevel as uint,
SampleCount as uint,
GatherTimeStats as uint);
}
印刷し1 10 14
ます。