"byteorder",
"bzip2",
"crc",
+ "serde",
"thiserror",
]
version = "0.1.0"
dependencies = [
"a2s",
+ "serde_json",
]
+[[package]]
+name = "itoa"
+version = "1.0.5"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440"
+
[[package]]
name = "libc"
version = "0.2.139"
"proc-macro2",
]
+[[package]]
+name = "ryu"
+version = "1.0.12"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7b4b9743ed687d4b4bcedf9ff5eaa7398495ae14e61cba0a295704edbc7decde"
+
+[[package]]
+name = "serde"
+version = "1.0.152"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb"
+dependencies = [
+ "serde_derive",
+]
+
+[[package]]
+name = "serde_derive"
+version = "1.0.152"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e"
+dependencies = [
+ "proc-macro2",
+ "quote",
+ "syn",
+]
+
+[[package]]
+name = "serde_json"
+version = "1.0.93"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "cad406b69c91885b5107daf2c29572f6c8cdb3c66826821e286c533490c0bc76"
+dependencies = [
+ "itoa",
+ "ryu",
+ "serde",
+]
+
[[package]]
name = "syn"
version = "1.0.107"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
-a2s = "0.5.1"
+a2s = { version = "0.5.1", features = ["serialization"] }
+serde_json = "1.0.93"
println!("Querying address: {}", address);
- let result = client.info(address);
- println!("{:?}\n", result);
+ if let Ok(result) = client.info(address) {
+ println!("{}\n", serde_json::to_string_pretty(&result).unwrap());
+ }
- let result = client.rules(address);
- println!("{:?}\n", result);
+ if let Ok(result) = client.rules(address) {
+ println!("{}\n", serde_json::to_string_pretty(&result).unwrap());
+ }
- let result = client.players(address);
- println!("{:?}\n", result);
+ if let Ok(result) = client.players(address) {
+ println!("{}\n", serde_json::to_string_pretty(&result).unwrap());
+ }
}
}