mirror of
https://github.com/KaiserY/trpl-zh-cn
synced 2025-04-22 05:18:04 +08:00
24 lines
398 B
Rust
24 lines
398 B
Rust
fn main() {
|
|
// ANCHOR: here
|
|
enum IpAddrKind {
|
|
V4,
|
|
V6,
|
|
}
|
|
|
|
struct IpAddr {
|
|
kind: IpAddrKind,
|
|
address: String,
|
|
}
|
|
|
|
let home = IpAddr {
|
|
kind: IpAddrKind::V4,
|
|
address: String::from("127.0.0.1"),
|
|
};
|
|
|
|
let loopback = IpAddr {
|
|
kind: IpAddrKind::V6,
|
|
address: String::from("::1"),
|
|
};
|
|
// ANCHOR_END: here
|
|
}
|