Skip to main content

ironflow_ops_docker/containers/
mod.rs

1//! Container operations.
2//!
3//! Operations are grouped by concern:
4//!
5//! | Module | Operations |
6//! |--------|-----------|
7//! | [`create`] | Create |
8//! | [`lifecycle`] | Start, Stop, Restart |
9//! | [`manage`] | Kill, Remove, Inspect, List |
10//! | [`exec`] | Logs, Exec, Wait |
11//! | [`state`] | Pause, Unpause, Rename, Top |
12//! | [`cleanup`] | Stats, Changes, Prune |
13
14pub mod cleanup;
15pub mod create;
16pub mod exec;
17pub mod lifecycle;
18pub mod manage;
19pub mod state;
20
21pub use cleanup::*;
22pub use create::*;
23pub use exec::*;
24pub use lifecycle::*;
25pub use manage::*;
26pub use state::*;
27
28use bollard::Docker;
29
30/// Wrapper enabling `impl Into<DockerRef>` on operation constructors.
31///
32/// This allows passing either a [`DockerClient`](crate::DockerClient) or a
33/// `&DockerClient` to any operation constructor without explicit conversion.
34pub struct DockerRef(pub(crate) Docker);
35
36impl From<crate::DockerClient> for DockerRef {
37    fn from(client: crate::DockerClient) -> Self {
38        Self(client.into_inner())
39    }
40}
41
42impl From<&crate::DockerClient> for DockerRef {
43    fn from(client: &crate::DockerClient) -> Self {
44        Self(client.docker().clone())
45    }
46}