docker_client_async/types/
container.rs

1/*
2 * Copyright 2020 Damian Peckett <damian@pecke.tt>.
3 * Copyright 2013-2018 Docker, Inc.
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 *     https://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17
18use crate::types::blkio::{ThrottleDevice, WeightDevice};
19use crate::types::host::{DeviceMapping, DeviceRequest, HostConfig, RestartPolicy, Ulimit};
20use crate::types::network::{Address, NetworkingConfig};
21use crate::types::port::{PortMap, PortSet};
22use derive_builder::Builder;
23use serde::{Deserialize, Serialize};
24use serde_json::Value;
25use std::collections::HashMap;
26
27/// Container contains response of Engine API:
28/// GET "/containers/json"
29#[derive(Clone, Debug, Default, Deserialize, Serialize, Builder)]
30#[builder(default, setter(into))]
31pub struct Container {
32    #[serde(rename = "Id")]
33    pub id: String,
34    #[serde(rename = "Name")]
35    #[serde(skip_serializing_if = "Option::is_none")]
36    pub name: Option<String>,
37    #[serde(rename = "Names")]
38    #[serde(skip_serializing_if = "Option::is_none")]
39    pub names: Option<Vec<String>>,
40    #[serde(rename = "Image")]
41    pub image: String,
42    #[serde(rename = "ImageID")]
43    #[serde(skip_serializing_if = "Option::is_none")]
44    pub image_id: Option<String>,
45    #[serde(rename = "Command")]
46    #[serde(skip_serializing_if = "Option::is_none")]
47    pub command: Option<String>,
48    #[serde(rename = "Created")]
49    pub created: Value,
50    #[serde(rename = "Path")]
51    #[serde(skip_serializing_if = "Option::is_none")]
52    pub path: Option<String>,
53    #[serde(rename = "Args")]
54    #[serde(skip_serializing_if = "Option::is_none")]
55    pub args: Option<Vec<String>>,
56    #[serde(rename = "ResolvConfPath")]
57    #[serde(skip_serializing_if = "Option::is_none")]
58    pub resolv_conf_path: Option<String>,
59    #[serde(rename = "HostnamePath")]
60    #[serde(skip_serializing_if = "Option::is_none")]
61    pub hostname_path: Option<String>,
62    #[serde(rename = "HostsPath")]
63    #[serde(skip_serializing_if = "Option::is_none")]
64    pub hosts_path: Option<String>,
65    #[serde(rename = "LogPath")]
66    #[serde(skip_serializing_if = "Option::is_none")]
67    pub log_path: Option<String>,
68    #[serde(rename = "RestartCount")]
69    #[serde(skip_serializing_if = "Option::is_none")]
70    pub restart_count: Option<i32>,
71    #[serde(rename = "Driver")]
72    #[serde(skip_serializing_if = "Option::is_none")]
73    pub driver: Option<String>,
74    #[serde(rename = "Platform")]
75    #[serde(skip_serializing_if = "Option::is_none")]
76    pub platform: Option<String>,
77    #[serde(rename = "MountLabel")]
78    #[serde(skip_serializing_if = "Option::is_none")]
79    pub mount_label: Option<String>,
80    #[serde(rename = "ProcessLabel")]
81    #[serde(skip_serializing_if = "Option::is_none")]
82    pub process_label: Option<String>,
83    #[serde(rename = "AppArmorProfile")]
84    #[serde(skip_serializing_if = "Option::is_none")]
85    pub app_armor_profile: Option<String>,
86    #[serde(rename = "ExecIDs")]
87    #[serde(skip_serializing_if = "Option::is_none")]
88    pub exec_ids: Option<Vec<String>>,
89    #[serde(rename = "GraphDriver")]
90    #[serde(skip_serializing_if = "Option::is_none")]
91    pub graph_driver: Option<GraphDriverData>,
92    #[serde(rename = "Ports")]
93    #[serde(skip_serializing_if = "Option::is_none")]
94    pub ports: Option<Vec<super::port::Port>>,
95    #[serde(rename = "SizeRw")]
96    #[serde(skip_serializing_if = "Option::is_none")]
97    pub size_rw: Option<i64>,
98    #[serde(rename = "SizeRootFs")]
99    #[serde(skip_serializing_if = "Option::is_none")]
100    pub size_root_fs: Option<i64>,
101    #[serde(rename = "Labels")]
102    #[serde(skip_serializing_if = "Option::is_none")]
103    pub labels: Option<HashMap<String, String>>,
104    #[serde(rename = "State")]
105    #[serde(skip_serializing_if = "Option::is_none")]
106    pub state: Option<Value>,
107    #[serde(rename = "Status")]
108    #[serde(skip_serializing_if = "Option::is_none")]
109    pub status: Option<String>,
110    #[serde(rename = "HostConfig")]
111    #[serde(skip_serializing_if = "Option::is_none")]
112    pub host_config: Option<HostConfig>,
113    #[serde(rename = "NetworkSettings")]
114    #[serde(skip_serializing_if = "Option::is_none")]
115    pub network_settings: Option<NetworkSettings>,
116    #[serde(rename = "Mounts")]
117    #[serde(skip_serializing_if = "Option::is_none")]
118    pub mounts: Option<Vec<super::mounts::MountPoint>>,
119    #[serde(rename = "Config")]
120    #[serde(skip_serializing_if = "Option::is_none")]
121    pub config: Option<ContainerConfig>,
122}
123
124/// NetworkSettings exposes the network settings in the api.
125#[derive(Clone, Debug, Default, Deserialize, Serialize, Builder)]
126#[builder(default, setter(into))]
127pub struct NetworkSettings {
128    /// bridge is the Bridge name the network uses(e.g. `docker0`).
129    #[serde(rename = "Bridge")]
130    #[serde(skip_serializing_if = "Option::is_none")]
131    pub bridge: Option<String>,
132    /// sandbox_id uniquely represents a container's network stack.
133    #[serde(rename = "SandboxID")]
134    #[serde(skip_serializing_if = "Option::is_none")]
135    pub sandbox_id: Option<String>,
136    /// hairpin_mode specifies if hairpin NAT should be enabled on the virtual interface.
137    #[serde(rename = "HairpinMode")]
138    #[serde(skip_serializing_if = "Option::is_none")]
139    pub hairpin_mode: Option<bool>,
140    /// link_local_ipv6_address is an IPv6 unicast address using the link-local prefix.
141    #[serde(rename = "LinkLocalIPv6Address")]
142    #[serde(skip_serializing_if = "Option::is_none")]
143    pub link_local_ipv6_address: Option<String>,
144    /// link_local_ipv6_prefix_len is the prefix length of an IPv6 unicast address.
145    #[serde(rename = "LinkLocalIPv6PrefixLen")]
146    #[serde(skip_serializing_if = "Option::is_none")]
147    pub link_local_ipv6_prefix_len: Option<i32>,
148    /// ports is a collection of PortBinding indexed by Port.
149    #[serde(rename = "Ports")]
150    #[serde(skip_serializing_if = "Option::is_none")]
151    pub ports: Option<PortMap>,
152    /// sandbox_key identifies the sandbox
153    #[serde(rename = "SandboxKey")]
154    #[serde(skip_serializing_if = "Option::is_none")]
155    pub sandbox_key: Option<String>,
156    #[serde(rename = "SecondaryIPAddresses")]
157    #[serde(skip_serializing_if = "Option::is_none")]
158    pub secondary_ip_addresses: Option<Vec<Address>>,
159    #[serde(rename = "SecondaryIPv6Addresses")]
160    #[serde(skip_serializing_if = "Option::is_none")]
161    pub secondary_ipv6_addresses: Option<Vec<Address>>,
162    /// endpoint_id uniquely represents a service endpoint in a Sandbox.
163    #[serde(rename = "EndpointID")]
164    #[serde(skip_serializing_if = "Option::is_none")]
165    pub endpoint_id: Option<String>,
166    /// gateway holds the gateway address for the network
167    #[serde(rename = "Gateway")]
168    #[serde(skip_serializing_if = "Option::is_none")]
169    pub gateway: Option<String>,
170    /// global_ipv6_address holds network's global IPv6 address.
171    #[serde(rename = "GlobalIPv6Address")]
172    #[serde(skip_serializing_if = "Option::is_none")]
173    pub global_ipv6_address: Option<String>,
174    /// global_ipv6_prefix_len represents mask length of network's global IPv6 address.
175    #[serde(rename = "GlobalIPv6PrefixLen")]
176    #[serde(skip_serializing_if = "Option::is_none")]
177    pub global_ipv6_prefix_len: Option<i32>,
178    /// ip_address holds the IPv4 address for the network.
179    #[serde(rename = "IPAddress")]
180    #[serde(skip_serializing_if = "Option::is_none")]
181    pub ip_address: Option<String>,
182    /// ip_prefix_len represents mask length of network's IPv4 address.
183    #[serde(rename = "IPPrefixLen")]
184    #[serde(skip_serializing_if = "Option::is_none")]
185    pub ip_prefix_len: Option<i32>,
186    /// ipv6_gateway holds gateway address specific for IPv6.
187    #[serde(rename = "IPv6Gateway")]
188    #[serde(skip_serializing_if = "Option::is_none")]
189    pub ipv6_gateway: Option<String>,
190    /// MacAddress holds the MAC address for the network.
191    #[serde(rename = "MacAddress")]
192    #[serde(skip_serializing_if = "Option::is_none")]
193    pub mac_address: Option<String>,
194    #[serde(rename = "Networks")]
195    #[serde(skip_serializing_if = "Option::is_none")]
196    pub networks: Option<HashMap<String, super::network::EndpointSettings>>,
197}
198
199/// ContainerConfig contains the configuration data about a container.
200/// It should hold only portable information about the container.
201/// Here, "portable" means "independent from the host we are running on".
202/// Non-portable information *should* appear in HostConfig.
203#[derive(Clone, Debug, Default, Deserialize, Serialize, Builder)]
204#[builder(default, setter(into))]
205pub struct ContainerConfig {
206    /// Hostname.
207    #[serde(rename = "Hostname")]
208    #[serde(skip_serializing_if = "Option::is_none")]
209    pub hostname: Option<String>,
210    /// Domainname.
211    #[serde(rename = "Domainname")]
212    #[serde(skip_serializing_if = "Option::is_none")]
213    pub domainname: Option<String>,
214    /// User that will run the command(s) inside the container, also support user:group.
215    #[serde(rename = "User")]
216    #[serde(skip_serializing_if = "Option::is_none")]
217    pub user: Option<String>,
218    /// Attach the standard input, makes possible user interaction.
219    #[serde(rename = "AttachStdin")]
220    #[serde(skip_serializing_if = "Option::is_none")]
221    pub attach_stdin: Option<bool>,
222    /// Attach the standard output.
223    #[serde(rename = "AttachStdout")]
224    #[serde(skip_serializing_if = "Option::is_none")]
225    pub attach_stdout: Option<bool>,
226    /// Attach the standard error.
227    #[serde(rename = "AttachStderr")]
228    #[serde(skip_serializing_if = "Option::is_none")]
229    pub attach_stderr: Option<bool>,
230    /// List of exposed ports.
231    #[serde(rename = "ExposedPorts")]
232    #[serde(skip_serializing_if = "Option::is_none")]
233    pub exposed_ports: Option<PortSet>,
234    /// Attach standard streams to a tty, including stdin if it is not closed.
235    #[serde(rename = "Tty")]
236    #[serde(skip_serializing_if = "Option::is_none")]
237    pub tty: Option<bool>,
238    /// Open stdin.
239    #[serde(rename = "OpenStdin")]
240    #[serde(skip_serializing_if = "Option::is_none")]
241    pub open_stdin: Option<bool>,
242    /// If true, close stdin after the 1 attached client disconnects.
243    #[serde(rename = "StdinOnce")]
244    #[serde(skip_serializing_if = "Option::is_none")]
245    pub stdin_once: Option<bool>,
246    /// List of environment variable to set in the container.
247    #[serde(rename = "Env")]
248    #[serde(skip_serializing_if = "Option::is_none")]
249    pub env: Option<Vec<String>>,
250    /// Command to run when starting the container.
251    #[serde(rename = "Cmd")]
252    #[serde(skip_serializing_if = "Option::is_none")]
253    pub cmd: Option<Vec<String>>,
254    /// Healthcheck describes how to check the container is healthy.
255    #[serde(rename = "Healthcheck")]
256    #[serde(skip_serializing_if = "Option::is_none")]
257    pub healthcheck: Option<HealthConfig>,
258    /// True if command is already escaped (meaning treat as a command line) (Windows specific).
259    #[serde(rename = "ArgsEscaped")]
260    #[serde(skip_serializing_if = "Option::is_none")]
261    pub args_escaped: Option<bool>,
262    /// Name of the image as it was passed by the operator (e.g. could be symbolic).
263    #[serde(rename = "Image")]
264    #[serde(skip_serializing_if = "Option::is_none")]
265    pub image: Option<String>,
266    /// List of volumes (mounts) used for the container.
267    #[serde(rename = "Volumes")]
268    #[serde(skip_serializing_if = "Option::is_none")]
269    pub volumes: Option<HashMap<String, Value>>,
270    /// Current directory (PWD) in the command will be launched.
271    #[serde(rename = "WorkingDir")]
272    #[serde(skip_serializing_if = "Option::is_none")]
273    pub working_dir: Option<String>,
274    /// Entrypoint to run when starting the container.
275    #[serde(rename = "Entrypoint")]
276    #[serde(skip_serializing_if = "Option::is_none")]
277    pub entrypoint: Option<Vec<String>>,
278    /// Is network disabled.
279    #[serde(rename = "NetworkDisabled")]
280    #[serde(skip_serializing_if = "Option::is_none")]
281    pub network_disabled: Option<bool>,
282    /// Mac Address of the container.
283    #[serde(rename = "MacAddress")]
284    #[serde(skip_serializing_if = "Option::is_none")]
285    pub mac_address: Option<String>,
286    /// ONBUILD metadata that were defined on the image Dockerfile.
287    #[serde(rename = "OnBuild")]
288    #[serde(skip_serializing_if = "Option::is_none")]
289    pub on_build: Option<Vec<String>>,
290    /// List of labels set to this container.
291    #[serde(rename = "Labels")]
292    #[serde(skip_serializing_if = "Option::is_none")]
293    pub labels: Option<HashMap<String, String>>,
294    /// Signal to stop a container.
295    #[serde(rename = "StopSignal")]
296    #[serde(skip_serializing_if = "Option::is_none")]
297    pub stop_signal: Option<String>,
298    /// Timeout (in seconds) to stop a container.
299    #[serde(rename = "StopTimeout")]
300    #[serde(skip_serializing_if = "Option::is_none")]
301    pub stop_timeout: Option<i32>,
302    /// Shell for shell-form of RUN, CMD, ENTRYPOINT.
303    #[serde(rename = "Shell")]
304    #[serde(skip_serializing_if = "Option::is_none")]
305    pub shell: Option<Vec<String>>,
306    /// Container configuration that depends on the host we are running on.
307    #[serde(rename = "HostConfig")]
308    #[serde(skip_serializing_if = "Option::is_none")]
309    pub host_config: Option<HostConfig>,
310    /// This container's networking configuration.
311    #[serde(rename = "NetworkingConfig")]
312    #[serde(skip_serializing_if = "Option::is_none")]
313    pub networking_config: Option<NetworkingConfig>,
314}
315
316/// HealthConfig holds configuration settings for the HEALTHCHECK feature.
317#[derive(Clone, Debug, Default, Deserialize, Serialize, Builder)]
318#[builder(default, setter(into))]
319pub struct HealthConfig {
320    /// Test is the test to perform to check that the container is healthy.
321    /// An empty slice means to inherit the default.
322    /// The options are:
323    /// {} : inherit healthcheck.
324    /// {"NONE"} : disable healthcheck.
325    /// {"CMD", args...} : exec arguments directly.
326    /// {"CMD-SHELL", command} : run command with system's default shell.
327    #[serde(rename = "Test")]
328    #[serde(skip_serializing_if = "Option::is_none")]
329    pub test: Option<Vec<String>>,
330    /// Zero means to inherit. Durations are expressed as integer nanoseconds.
331    /// interval_nanoseconds is the time to wait between checks.
332    #[serde(rename = "Interval")]
333    #[serde(skip_serializing_if = "Option::is_none")]
334    pub interval_nanoseconds: Option<i64>,
335    /// Timeout is the time to wait before considering the check to have hung.
336    #[serde(rename = "Timeout")]
337    #[serde(skip_serializing_if = "Option::is_none")]
338    pub timeout_nanoseconds: Option<i64>,
339    /// The start period for the container to initialize before the retries starts to count down.
340    #[serde(rename = "StartPeriod")]
341    #[serde(skip_serializing_if = "Option::is_none")]
342    pub start_period_nanoseconds: Option<i64>,
343    /// Retries is the number of consecutive failures needed to consider a container as unhealthy.
344    /// Zero means inherit.
345    #[serde(rename = "Retries")]
346    #[serde(skip_serializing_if = "Option::is_none")]
347    pub retries: Option<i32>,
348}
349
350/// UpdateConfig holds the mutable attributes of a Container.
351/// Those attributes can be updated at runtime.
352#[derive(Clone, Debug, Default, Deserialize, Serialize, Builder)]
353#[builder(default, setter(into))]
354pub struct UpdateConfig {
355    /// CPU shares (relative weight vs. other containers).
356    #[serde(rename = "CpuShares")]
357    #[serde(skip_serializing_if = "Option::is_none")]
358    pub cpu_shares: Option<i64>,
359    /// Memory limit (in bytes).
360    #[serde(rename = "Memory")]
361    #[serde(skip_serializing_if = "Option::is_none")]
362    pub memory: Option<i64>,
363    /// CPU quota in units of 10<sup>-9</sup> CPUs.
364    #[serde(rename = "NanoCPUs")]
365    #[serde(skip_serializing_if = "Option::is_none")]
366    pub nano_cpus: Option<i64>,
367    /// Parent cgroup.
368    #[serde(rename = "CgroupParent")]
369    #[serde(skip_serializing_if = "Option::is_none")]
370    pub cgroup_parent: Option<String>,
371    /// Block IO weight (relative weight vs. other containers).
372    #[serde(rename = "BlkioWeight")]
373    #[serde(skip_serializing_if = "Option::is_none")]
374    pub blkio_weight: Option<u16>,
375    #[serde(rename = "BlkioWeightDevice")]
376    #[serde(skip_serializing_if = "Option::is_none")]
377    pub blkio_weight_device: Option<Vec<WeightDevice>>,
378    #[serde(rename = "BlkioDeviceReadBps")]
379    #[serde(skip_serializing_if = "Option::is_none")]
380    pub blkio_device_read_bps: Option<Vec<ThrottleDevice>>,
381    #[serde(rename = "BlkioDeviceWriteBps")]
382    #[serde(skip_serializing_if = "Option::is_none")]
383    pub blkio_device_write_bps: Option<Vec<ThrottleDevice>>,
384    #[serde(rename = "BlkioDeviceReadIOps")]
385    #[serde(skip_serializing_if = "Option::is_none")]
386    pub blkio_device_read_iops: Option<Vec<ThrottleDevice>>,
387    #[serde(rename = "BlkioDeviceWriteIOps")]
388    #[serde(skip_serializing_if = "Option::is_none")]
389    pub blkio_device_write_iops: Option<Vec<ThrottleDevice>>,
390    /// CPU CFS (Completely Fair Scheduler) period.
391    #[serde(rename = "CpuPeriod")]
392    #[serde(skip_serializing_if = "Option::is_none")]
393    pub cpu_period: Option<i64>,
394    /// CPU CFS (Completely Fair Scheduler) quota.
395    #[serde(rename = "CpuQuota")]
396    #[serde(skip_serializing_if = "Option::is_none")]
397    pub cpu_quota: Option<i64>,
398    /// CPU real-time period.
399    #[serde(rename = "CpuRealtimePeriod")]
400    #[serde(skip_serializing_if = "Option::is_none")]
401    pub cpu_realtime_period: Option<i64>,
402    /// CPU real-time runtime.
403    #[serde(rename = "CpuRealtimeRuntime")]
404    #[serde(skip_serializing_if = "Option::is_none")]
405    pub cpu_realtime_runtime: Option<i64>,
406    /// CpusetCpus 0-2, 0,1.
407    #[serde(rename = "CpusetCpus")]
408    #[serde(skip_serializing_if = "Option::is_none")]
409    pub cpuset_cpus: Option<String>,
410    /// CpusetMems 0-2, 0,1.
411    #[serde(rename = "CpusetMems")]
412    #[serde(skip_serializing_if = "Option::is_none")]
413    pub cpuset_mems: Option<String>,
414    /// List of devices to map inside the container.
415    #[serde(rename = "Devices")]
416    #[serde(skip_serializing_if = "Option::is_none")]
417    pub devices: Option<Vec<DeviceMapping>>,
418    /// List of rule to be added to the device cgroup.
419    #[serde(rename = "DeviceCgroupRules")]
420    #[serde(skip_serializing_if = "Option::is_none")]
421    pub device_cgroup_rules: Option<Vec<String>>,
422    /// List of device requests for device drivers.
423    #[serde(rename = "DeviceRequests")]
424    #[serde(skip_serializing_if = "Option::is_none")]
425    pub device_requests: Option<Vec<DeviceRequest>>,
426    /// Kernel memory limit (in bytes).
427    #[serde(rename = "KernelMemory")]
428    #[serde(skip_serializing_if = "Option::is_none")]
429    pub kernel_memory: Option<i64>,
430    /// Hard limit for kernel TCP buffer memory (in bytes).
431    #[serde(rename = "KernelMemoryTCP")]
432    #[serde(skip_serializing_if = "Option::is_none")]
433    pub kernel_memory_tcp: Option<i64>,
434    /// Memory soft limit (in bytes).
435    #[serde(rename = "MemoryReservation")]
436    #[serde(skip_serializing_if = "Option::is_none")]
437    pub memory_reservation: Option<i64>,
438    /// Total memory usage (memory + swap); set `-1` to enable unlimited swap.
439    #[serde(rename = "MemorySwap")]
440    #[serde(skip_serializing_if = "Option::is_none")]
441    pub memory_swap: Option<i64>,
442    /// Tuning container memory swappiness behaviour.
443    #[serde(rename = "MemorySwappiness")]
444    #[serde(skip_serializing_if = "Option::is_none")]
445    pub memory_swappiness: Option<i64>,
446    /// Whether to disable OOM Killer or not.
447    #[serde(rename = "OomKillDisable")]
448    #[serde(skip_serializing_if = "Option::is_none")]
449    pub oom_kill_disable: Option<bool>,
450    /// Setting PIDs limit for a container; Set `0` or `-1` for unlimited, or `null` to not change.
451    #[serde(rename = "PidsLimit")]
452    #[serde(skip_serializing_if = "Option::is_none")]
453    pub pids_limit: Option<i64>,
454    /// List of ulimits to be set in the container.
455    #[serde(rename = "Ulimits")]
456    #[serde(skip_serializing_if = "Option::is_none")]
457    pub ulimits: Option<Vec<Ulimit>>,
458    /// CPU count.
459    #[serde(rename = "CpuCount")]
460    #[serde(skip_serializing_if = "Option::is_none")]
461    pub cpu_count: Option<i64>,
462    /// CPU percent.
463    #[serde(rename = "CpuPercent")]
464    #[serde(skip_serializing_if = "Option::is_none")]
465    pub cpu_percent: Option<i64>,
466    /// Maximum IOps for the container system drive.
467    #[serde(rename = "IOMaximumIOps")]
468    #[serde(skip_serializing_if = "Option::is_none")]
469    pub io_maximum_iops: Option<u64>,
470    /// Maximum IO in bytes per second for the container system drive.
471    #[serde(rename = "IOMaximumBandwidth")]
472    #[serde(skip_serializing_if = "Option::is_none")]
473    pub io_maximum_bandwidth: Option<u64>,
474    /// Restart policy to be used for the container.
475    #[serde(rename = "RestartPolicy")]
476    #[serde(skip_serializing_if = "Option::is_none")]
477    pub restart_policy: Option<RestartPolicy>,
478}
479
480/// WaitCondition is a type used to specify a container state for which
481/// to wait.
482pub enum WaitCondition {
483    NotRunning,
484    NextExit,
485    Removed,
486}
487
488impl ToString for WaitCondition {
489    fn to_string(&self) -> String {
490        match self {
491            WaitCondition::NotRunning => "not-running".into(),
492            WaitCondition::NextExit => "next-exit".into(),
493            WaitCondition::Removed => "removed".into(),
494        }
495    }
496}
497
498/// GraphDriverData Information about a container's graph driver.
499#[derive(Clone, Debug, Default, Deserialize, Serialize, Builder)]
500#[builder(default, setter(into))]
501pub struct GraphDriverData {
502    /// data.
503    #[serde(rename = "Data")]
504    #[serde(skip_serializing_if = "Option::is_none")]
505    pub data: Option<HashMap<String, String>>,
506    /// name.
507    #[serde(rename = "Name")]
508    #[serde(skip_serializing_if = "Option::is_none")]
509    pub name: Option<String>,
510}