partition_sim/commands/
mod.rs1mod fs;
2mod ip;
3mod ssh;
4
5pub use fs::FsCommands;
6pub use ip::IpTablesCommands;
7pub use ssh::SshCommands;
8
9pub trait Command {
12 fn build<'session>(&self, session: &'session openssh::Session) -> openssh::Command<'session>;
14}
15
16#[derive(Debug, Clone, PartialEq, Eq)]
18pub enum Commands {
19 IpTables(IpTablesCommands),
21 Fs(FsCommands),
23}
24
25impl Command for Commands {
26 fn build<'session>(&self, session: &'session openssh::Session) -> openssh::Command<'session> {
27 match self {
28 Self::IpTables(command) => command.build(session),
29 Self::Fs(command) => command.build(session),
30 }
31 }
32}