From 1ba083af3576d20b5c1fc1c6ebacefd91ceb6636 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sat, 4 Jan 2020 13:15:00 +0100 Subject: abconfig: reorg + parse result into struct. --- examples/zot/abconfig.rs | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'examples') 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); -- cgit v1.2.3