1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
use containers_api::{impl_field, impl_opts_builder, impl_str_field, impl_vec_field};
use serde::Serialize;
impl_opts_builder!(json => ExecCreate);
#[derive(Copy, Clone, PartialEq, Debug)]
pub struct ConsoleSize {
pub height: u64,
pub width: u64,
}
impl Serialize for ConsoleSize {
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where
S: serde::Serializer,
{
[self.height, self.width].serialize(serializer)
}
}
impl ExecCreateOptsBuilder {
impl_vec_field!(
command => "Cmd"
);
impl_vec_field!(
env => "Env"
);
impl_field!(
attach_stdout: bool => "AttachStdout"
);
impl_field!(
attach_stderr: bool => "AttachStderr"
);
impl_str_field!(
detach_keys => "DetachKeys"
);
impl_field!(
tty: bool => "Tty"
);
impl_field!(
privileged: bool => "Privileged"
);
impl_str_field!(
user => "User"
);
impl_str_field!(
working_dir => "WorkingDir"
);
impl_field!(
console_size: ConsoleSize => "ConsoleSize"
);
}
impl_opts_builder!(json => ExecResize);
impl ExecResizeOptsBuilder {
impl_field!(height: u64 => "Height");
impl_field!(width: u64 => "Width");
}