summaryrefslogtreecommitdiffstats
path: root/examples/images.rs
diff options
context:
space:
mode:
Diffstat (limited to 'examples/images.rs')
-rw-r--r--examples/images.rs20
1 files changed, 15 insertions, 5 deletions
diff --git a/examples/images.rs b/examples/images.rs
index 195ea06..b3e80a8 100644
--- a/examples/images.rs
+++ b/examples/images.rs
@@ -1,10 +1,20 @@
extern crate shiplift;
+extern crate tokio;
+
+use shiplift::Docker;
+use tokio::prelude::Future;
fn main() {
- let docker = shiplift::Docker::new();
- let images = docker.images().list(&Default::default()).unwrap();
+ let docker = Docker::new();
println!("docker images in stock");
- for i in images {
- println!("{:?}", i.repo_tags);
- }
+ let fut = docker
+ .images()
+ .list(&Default::default())
+ .map(|images| {
+ for i in images {
+ println!("{:?}", i.repo_tags);
+ }
+ })
+ .map_err(|e| eprintln!("Error: {}", e));
+ tokio::run(fut);
}