soroban_cli/commands/contract/
bindings.rs1pub mod flutter;
2pub mod java;
3pub mod php;
4pub mod python;
5pub mod rust;
6pub mod swift;
7pub mod typescript;
8
9#[derive(Debug, clap::Subcommand)]
10pub enum Cmd {
11 Rust(rust::Cmd),
13
14 Typescript(Box<typescript::Cmd>),
16
17 Python(python::Cmd),
19
20 Java(java::Cmd),
22
23 Flutter(flutter::Cmd),
25
26 Swift(swift::Cmd),
28
29 Php(php::Cmd),
31}
32
33#[derive(thiserror::Error, Debug)]
34pub enum Error {
35 #[error(transparent)]
36 Rust(#[from] rust::Error),
37
38 #[error(transparent)]
39 Typescript(#[from] typescript::Error),
40
41 #[error(transparent)]
42 Python(#[from] python::Error),
43
44 #[error(transparent)]
45 Java(#[from] java::Error),
46
47 #[error(transparent)]
48 Flutter(#[from] flutter::Error),
49
50 #[error(transparent)]
51 Swift(#[from] swift::Error),
52
53 #[error(transparent)]
54 Php(#[from] php::Error),
55}
56
57impl Cmd {
58 pub async fn run(&self) -> Result<(), Error> {
59 match &self {
60 Cmd::Rust(rust) => rust.run()?,
61 Cmd::Typescript(ts) => ts.run().await?,
62 Cmd::Python(python) => python.run()?,
63 Cmd::Java(java) => java.run()?,
64 Cmd::Flutter(flutter) => flutter.run()?,
65 Cmd::Swift(swift) => swift.run()?,
66 Cmd::Php(php) => php.run()?,
67 }
68 Ok(())
69 }
70}