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