aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2020-01-04 13:15:00 +0100
committerHarald Eilertsen <haraldei@anduin.net>2020-01-04 13:15:00 +0100
commit1ba083af3576d20b5c1fc1c6ebacefd91ceb6636 (patch)
tree54a04c60fcd6721ab5c0cb782f1fc2bef38538b7 /examples
parent862a3b67d701b3c124e1b682db0cee5fc5b711da (diff)
downloadrust-zotapi-1ba083af3576d20b5c1fc1c6ebacefd91ceb6636.tar.gz
rust-zotapi-1ba083af3576d20b5c1fc1c6ebacefd91ceb6636.tar.bz2
rust-zotapi-1ba083af3576d20b5c1fc1c6ebacefd91ceb6636.zip
abconfig: reorg + parse result into struct.
Diffstat (limited to 'examples')
-rw-r--r--examples/zot/abconfig.rs15
1 files changed, 12 insertions, 3 deletions
diff --git a/examples/zot/abconfig.rs b/examples/zot/abconfig.rs
index 2362408..a6454ac 100644
--- a/examples/zot/abconfig.rs
+++ b/examples/zot/abconfig.rs
@@ -18,9 +18,18 @@
use zotapi;
pub fn fetch(client: &zotapi::Client) {
- match zotapi::abconfig().fetch(&client) {
- Ok(payload) => {
- println!("{}", payload);
+ match zotapi::abconfig::fetch(&client) {
+ Ok(v) => {
+ println!("Id: Chan: Cat: Key: Val: xchan:");
+ for entry in v {
+ println!("{:6} {:6} {:15} {:15} {:4} {}",
+ entry.id,
+ entry.chan,
+ entry.cat,
+ entry.k,
+ entry.v,
+ entry.xchan);
+ }
}
Err(e) => {
println!("{:?}", e);