summaryrefslogtreecommitdiffstats
path: root/examples/containers.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/containers.rs')
-rw-r--r--examples/containers.rs16
1 files changed, 13 insertions, 3 deletions
diff --git a/examples/containers.rs b/examples/containers.rs
index 27a5d20..71da705 100644
--- a/examples/containers.rs
+++ b/examples/containers.rs
@@ -1,12 +1,22 @@
extern crate env_logger;
extern crate shiplift;
+extern crate tokio;
use shiplift::Docker;
+use tokio::prelude::Future;
fn main() {
env_logger::init();
let docker = Docker::new();
- for c in docker.containers().list(&Default::default()).unwrap() {
- println!("container -> {:?}", c)
- }
+ let fut = docker
+ .containers()
+ .list(&Default::default())
+ .map(|containers| {
+ for c in containers {
+ println!("container -> {:#?}", c)
+ }
+ })
+ .map_err(|e| eprintln!("Error: {}", e));
+
+ tokio::run(fut);
}