docker_api/
lib.rs

1//! docker-api is a rust interface to [Docker](https://www.docker.com/) containers
2//!
3//! # example
4//!
5//! ```no_run
6//! # async {
7//! let docker = docker_api::Docker::new("tcp://127.0.0.1:80").unwrap();
8//!
9//! match docker.images().list(&Default::default()).await {
10//!     Ok(images) => {
11//!         for image in images {
12//!             println!("{0:?}", image.repo_tags);
13//!         }
14//!     },
15//!     Err(e) => eprintln!("Something bad happened! {e}"),
16//! }
17//! # };
18//! ```
19#![cfg_attr(docsrs, feature(doc_cfg))]
20
21/// Latest Docker API version supported by this crate.
22pub const LATEST_API_VERSION: ApiVersion = ApiVersion::new(1, Some(42), None);
23
24/// https://github.com/rust-lang/rust/issues/53749
25macro_rules! version {
26    () => {
27        "v1.42"
28    };
29}
30
31#[macro_use]
32mod builder;
33
34pub mod api;
35pub mod models;
36mod stream;
37pub mod conn {
38    //! Connection related items
39    pub(crate) use containers_api::conn::*;
40    pub use containers_api::conn::{Error, Transport, TtyChunk};
41}
42pub mod docker;
43pub mod errors;
44pub mod opts;
45
46pub use containers_api::id::Id;
47pub use containers_api::version::ApiVersion;
48
49pub use crate::{
50    api::{
51        container::{self, Container, Containers},
52        exec::{self, Exec},
53        image::{self, Image, Images},
54        network::{self, Network, Networks},
55        volume::{self, Volume, Volumes},
56    },
57    docker::Docker,
58    errors::{Error, Result},
59};
60
61#[cfg(feature = "swarm")]
62#[cfg_attr(docsrs, doc(cfg(feature = "swarm")))]
63pub use crate::api::{
64    config::{self, Config, Configs},
65    node::{self, Node, Nodes},
66    plugin::{self, Plugin, Plugins},
67    secret::{self, Secret, Secrets},
68    service::{self, Service, Services},
69    swarm::{self, Swarm},
70    task::{self, Task, Tasks},
71};