multiversx_sc/abi/
build_info_abi.rs1use alloc::{borrow::ToOwned, string::String};
2
3#[derive(Clone, Default, Debug)]
7pub struct BuildInfoAbi {
8 pub rustc: Option<RustcAbi>,
9 pub contract_crate: ContractCrateBuildAbi,
10 pub framework: FrameworkBuildAbi,
11}
12
13#[derive(Clone, Default, Debug)]
14pub struct RustcAbi {
15 pub version: String,
16 pub commit_hash: String,
17 pub commit_date: String,
18 pub build_date: Option<String>,
19 pub channel: String,
20 pub host: String,
21 pub short: String,
22 pub llvm_version: Option<String>,
23}
24
25#[derive(Clone, Default, Debug)]
26pub struct ContractCrateBuildAbi {
27 pub name: String,
28 pub version: String,
29 pub git_version: String,
30}
31
32impl ContractCrateBuildAbi {
33 pub fn new(name: &str, version: &str) -> Self {
37 ContractCrateBuildAbi {
38 name: name.to_owned(),
39 version: version.to_owned(),
40 git_version: String::new(),
41 }
42 }
43}
44
45#[derive(Clone, Default, Debug)]
48pub struct FrameworkBuildAbi {
49 pub name: String,
50 pub version: String,
51}
52
53impl FrameworkBuildAbi {
54 pub fn create() -> Self {
58 FrameworkBuildAbi {
59 name: env!("CARGO_PKG_NAME").to_owned(),
60 version: env!("CARGO_PKG_VERSION").to_owned(),
61 }
62 }
63}