docker_wrapper/
lib.rs

1//! # docker-wrapper
2//!
3//! A simple, focused Docker CLI wrapper for Rust.
4//!
5//! This crate provides a clean interface to Docker's common commands,
6//! focusing on reliability and ease of use.
7
8#![warn(missing_docs)]
9#![warn(clippy::all)]
10#![warn(clippy::pedantic)]
11
12pub mod command;
13pub mod error;
14pub mod prerequisites;
15
16pub use command::{
17    bake::BakeCommand,
18    build::{BuildCommand, BuildOutput},
19    exec::{ExecCommand, ExecOutput},
20    images::{ImageInfo, ImagesCommand, ImagesOutput},
21    info::{DockerInfo as SystemDockerInfo, InfoCommand, InfoOutput, SystemInfo},
22    login::{LoginCommand, LoginOutput},
23    logout::{LogoutCommand, LogoutOutput},
24    ps::{ContainerInfo, PsCommand, PsFormat, PsOutput},
25    pull::PullCommand,
26    push::PushCommand,
27    run::{ContainerId, MountType, RunCommand, VolumeMount},
28    search::{RepositoryInfo, SearchCommand, SearchOutput},
29    version::{ClientVersion, ServerVersion, VersionCommand, VersionInfo, VersionOutput},
30    CommandExecutor, CommandOutput, DockerCommand, EnvironmentBuilder, PortBuilder, PortMapping,
31    Protocol,
32};
33pub use error::{Error, Result};
34pub use prerequisites::{ensure_docker, DockerInfo, DockerPrerequisites};
35
36/// The version of this crate
37pub const VERSION: &str = env!("CARGO_PKG_VERSION");
38
39#[cfg(test)]
40mod tests {
41    use super::*;
42
43    #[test]
44    fn test_version() {
45        // Verify version follows semver format (major.minor.patch)
46        let parts: Vec<&str> = VERSION.split('.').collect();
47        assert!(parts.len() >= 3, "Version should have at least 3 parts");
48
49        // Verify each part is numeric
50        for part in &parts[0..3] {
51            assert!(
52                part.chars().all(|c| c.is_ascii_digit()),
53                "Version parts should be numeric"
54            );
55        }
56    }
57}