#[doc(inline)]
pub use self::connect::*;
mod connect;
use crate::Context;
#[derive(
Clone,
Debug,
Eq,
Hash,
Ord,
PartialEq,
PartialOrd,
clap::Subcommand,
serde::Deserialize,
serde::Serialize,
strum::EnumIs,
strum::VariantNames,
)]
#[repr(C)]
pub enum Command {
Connect(ConnectCmd),
}
impl Command {
pub const fn connect(cmd: ConnectCmd) -> Self {
Self::Connect(cmd)
}
pub fn name(&self) -> &str {
match self {
Self::Connect(_) => "connect",
}
}
#[tracing::instrument(skip_all)]
pub async fn handle(&self, ctx: &mut Context) -> anyhow::Result<()> {
match self {
Self::Connect(cmd) => cmd.handle(ctx).await,
}
}
}