summaryrefslogtreecommitdiffstats
path: root/examples/networkdelete.rs
blob: 16fc4ab6f9b656ddc28f2a8d5bad3c7a87f04442 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use shiplift::Docker;
use std::env;
use tokio::prelude::Future;

fn main() {
    let docker = Docker::new();
    let id = env::args()
        .nth(1)
        .expect("You need to specify a network id");
    let fut = docker
        .networks()
        .get(&id)
        .delete()
        .map(|network| println!("{:?}", network))
        .map_err(|e| eprintln!("Error: {}", e));

    tokio::run(fut);
}