swayipc_command_builder/commands/
assign.rs

1use super::*;
2
3impl Command<Assign> {
4    pub fn workspace(self) -> Command<Assign<Workspace>> {
5        self.push_str("workspace").transmute()
6    }
7
8    pub fn output(self) -> Command<Assign<Output>> {
9        self.push_str("output").transmute()
10    }
11}
12
13impl Command<Assign<Workspace>> {
14    pub fn name(self, name: impl AsRef<str>) -> Command<Valid> {
15        self.push_str(name).transmute()
16    }
17
18    pub fn number(self, number: isize) -> Command<Valid> {
19        self.push_str("number")
20            .push_str(number.to_string())
21            .transmute()
22    }
23}
24
25impl Command<Assign<Output>> {
26    pub fn name(self, name: impl AsRef<str>) -> Command<Valid> {
27        self.push_str(name).transmute()
28    }
29
30    pub fn up(self) -> Command<Valid> {
31        self.push_str("up").transmute()
32    }
33
34    pub fn right(self) -> Command<Valid> {
35        self.push_str("right").transmute()
36    }
37
38    pub fn down(self) -> Command<Valid> {
39        self.push_str("down").transmute()
40    }
41
42    pub fn left(self) -> Command<Valid> {
43        self.push_str("left").transmute()
44    }
45}