xabc_lib/
lib.rs

1pub mod abc;
2pub mod bytecode;
3pub mod class;
4pub mod code;
5mod error;
6pub mod field;
7pub mod header;
8pub mod literal;
9pub mod lnp;
10pub mod method;
11pub mod region;
12pub mod source;
13pub mod string;
14
15use scroll::{Sleb128, Uleb128};
16
17/// 8-bit 无符号整数
18#[allow(non_camel_case_types)]
19pub type uint8_t = u8;
20/// 16-bit无符号整数,采用小端字节序。
21#[allow(non_camel_case_types)]
22pub type uint16_t = u16;
23/// 32-bit无符号整数,采用小端字节序。
24#[allow(non_camel_case_types)]
25pub type uint32_t = u32;
26/// leb128编码的无符号整数
27#[allow(non_camel_case_types)]
28pub type uleb128_t = Uleb128;
29/// leb128编码的有符号整数。
30#[allow(non_camel_case_types)]
31pub type sleb128_t = Sleb128;
32
33// A `Result` of `T` or an error of `error::Error`
34//pub type Result<T> = std::result::Result<T, error::Error>;
35
36#[cfg(feature = "logging")]
37fn init_logging() {
38    // 测试运行的时候,不需要设置 RUST_LOG=debug
39    tracing_subscriber::fmt()
40        .with_max_level(tracing::Level::DEBUG)
41        .init();
42}
43
44#[cfg(not(feature = "logging"))]
45fn init_logging() {}