diff options
Diffstat (limited to 'examples/volumes.rs')
-rw-r--r-- | examples/volumes.rs | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/examples/volumes.rs b/examples/volumes.rs new file mode 100644 index 0000000..59c7b65 --- /dev/null +++ b/examples/volumes.rs @@ -0,0 +1,21 @@ +extern crate shiplift; +extern crate tokio; + +use shiplift::Docker; +use tokio::prelude::Future; + +fn main() { + let docker = Docker::new(); + let volumes = docker.volumes(); + + let fut = volumes + .list() + .map(|volumes| { + for v in volumes { + println!("volume -> {:#?}", v) + } + }) + .map_err(|e| eprintln!("Error: {}", e));; + + tokio::run(fut); +} |