trpl-zh-cn/listings/ch06-enums-and-pattern-matching/no-listing-04-structs-similar-to-message-enum/src/main.rs
2022-02-07 14:36:29 +08:00

12 lines
290 B
Rust
Executable File

// ANCHOR: here
struct QuitMessage; // 类单元结构体
struct MoveMessage {
x: i32,
y: i32,
}
struct WriteMessage(String); // 元组结构体
struct ChangeColorMessage(i32, i32, i32); // 元组结构体
// ANCHOR_END: here
fn main() {}