stackify_docker_api/opts/
exec.rs1use containers_api::{impl_field, impl_opts_builder, impl_str_field, impl_vec_field};
2use serde::Serialize;
3
4impl_opts_builder!(json => ExecCreate);
5
6#[derive(Copy, Clone, PartialEq, Debug)]
7pub struct ConsoleSize {
9 pub height: u64,
10 pub width: u64,
11}
12
13impl Serialize for ConsoleSize {
14 fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
15 where
16 S: serde::Serializer,
17 {
18 [self.height, self.width].serialize(serializer)
19 }
20}
21
22impl ExecCreateOptsBuilder {
23 impl_vec_field!(
24 command => "Cmd"
26 );
27
28 impl_vec_field!(
29 env => "Env"
31 );
32
33 impl_field!(
34 attach_stdout: bool => "AttachStdout"
36 );
37
38 impl_field!(
39 attach_stderr: bool => "AttachStderr"
41 );
42
43 impl_field!(
44 attach_stdin: bool => "AttachStdin"
46 );
47
48 impl_str_field!(
49 detach_keys => "DetachKeys"
52 );
53
54 impl_field!(
55 tty: bool => "Tty"
57 );
58
59 impl_field!(
60 privileged: bool => "Privileged"
62 );
63
64 impl_str_field!(
65 user => "User"
68 );
69
70 impl_str_field!(
71 working_dir => "WorkingDir"
73 );
74
75 impl_field!(
76 console_size: ConsoleSize => "ConsoleSize"
78 );
79}
80
81impl_opts_builder!(json => ExecResize);
82
83impl ExecResizeOptsBuilder {
84 impl_field!(height: u64 => "Height");
85 impl_field!(width: u64 => "Width");
86}
87
88impl_opts_builder!(json => ExecStart);
89
90impl ExecStartOptsBuilder {
91 impl_field!(
92 detach: bool => "Detach"
94 );
95
96 impl_field!(
97 tty: bool => "Tty"
99 );
100
101 impl_field!(
102 console_size: ConsoleSize => "ConsoleSize"
104 );
105}