1#[doc(inline)]
8pub use self::connect::*;
9
10mod connect;
11
12use crate::Context;
13
14#[derive(
15 Clone,
16 Debug,
17 Eq,
18 Hash,
19 Ord,
20 PartialEq,
21 PartialOrd,
22 clap::Subcommand,
23 serde::Deserialize,
24 serde::Serialize,
25 strum::EnumIs,
26 strum::VariantNames,
27)]
28#[repr(C)]
29pub enum Command {
30 Connect(ConnectCmd),
31}
32
33impl Command {
34 pub const fn connect(cmd: ConnectCmd) -> Self {
36 Self::Connect(cmd)
37 }
38 pub fn name(&self) -> &str {
40 match self {
41 Self::Connect(_) => "connect",
42 }
43 }
44 #[tracing::instrument(skip_all)]
46 pub async fn handle(&self, ctx: &mut Context) -> anyhow::Result<()> {
47 match self {
48 Self::Connect(cmd) => cmd.handle(ctx).await,
49 }
50 }
51}