// cargo run --example stats -- use futures::StreamExt; use moby::Docker; use std::env; #[tokio::main] async fn main() { let docker = Docker::new("tcp://127.0.0.1:80").unwrap(); let containers = docker.containers(); let id = env::args() .nth(1) .expect("Usage: cargo run --example stats -- "); while let Some(result) = containers.get(&id).stats().next().await { match result { Ok(stat) => println!("{:?}", stat), Err(e) => eprintln!("Error: {}", e), } } }