summaryrefslogtreecommitdiff
path: root/enumeration/src
diff options
context:
space:
mode:
authorJordan Gong <jordan.gong@protonmail.com>2020-08-17 15:23:47 +0800
committerJordan Gong <jordan.gong@protonmail.com>2020-08-17 15:23:47 +0800
commite15d77f54a26988ea1715cf4be6ec3f858772da4 (patch)
tree96107a1eda647d871e6933db1b0a3e7a9b5c0b47 /enumeration/src
parent2ae92ce449a8456a25a5faebf47f38fdfd9f226c (diff)
Enumberate
Diffstat (limited to 'enumeration/src')
-rw-r--r--enumeration/src/main.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/enumeration/src/main.rs b/enumeration/src/main.rs
new file mode 100644
index 0000000..f310ad6
--- /dev/null
+++ b/enumeration/src/main.rs
@@ -0,0 +1,25 @@
+enum Message {
+ Quit,
+ Move { x: i32, y: i32 },
+ Write(String),
+ ChangeColor(i32, i32, i32),
+}
+
+impl Message {
+ fn call(&self) {
+
+ }
+}
+
+fn main() {
+ enum IpAddr {
+ V4(u8, u8, u8, u8),
+ V6(String),
+ }
+
+ let home = IpAddr::V4(127, 0, 0, 1);
+ let loopback = IpAddr::V6(String::from("::1"));
+
+ let m = Message::Write(String::from("hello"));
+ m.call();
+}