Skip to main content

vacro/
lib.rs

1//! <div class="doc-en">
2//!
3#![doc = include_str!("docs/en.md")]
4//! </div>
5//!
6//! <div class="doc-cn">
7//!
8#![doc = include_str!("docs/zh_cn.md")]
9//!
10//! </div>
11
12use vacro_doc_i18n::doc_i18n;
13
14#[cfg(feature = "parser")]
15#[doc_i18n]
16pub mod parser {
17    //! @en Declarative parsing tools.
18    //! @cn 声明式解析工具。
19    pub use vacro_parser::*;
20}
21
22#[cfg(feature = "report")]
23#[doc_i18n]
24pub mod report {
25    //! @en Diagnostic reporting tools.
26    //! @cn 诊断报告工具。
27    #[doc(hidden)]
28    pub use vacro_report::__private;
29    pub use vacro_report::*;
30}
31
32#[cfg(feature = "trace")]
33#[doc_i18n]
34pub mod trace {
35    //! @en Observability and tracing tools.
36    //! @cn 可观测性追踪工具
37    pub use vacro_trace::*;
38}
39
40#[doc_i18n]
41/// @cn Vacro 常用功能的预导入模块。
42/// @en A prelude for convenient access to commonly used Vacro features.
43///
44///
45/// ::: @cn
46///
47/// 使用方式:
48/// ```rust
49/// use vacro::prelude::*;
50/// ```
51///
52/// :::
53///
54/// ::: @en
55///
56/// Usage:
57/// ```rust
58/// use vacro::prelude::*;
59/// ```
60///
61/// :::
62///
63pub mod prelude {
64    #[cfg(feature = "parser")]
65    pub use crate::parser::{bind, define};
66
67    #[cfg(feature = "report")]
68    pub use crate::report::scope as report_scope;
69
70    #[cfg(feature = "report")]
71    pub use crate::report::help;
72
73    #[cfg(feature = "trace")]
74    pub use crate::trace::{debug, error, info, instrument, snapshot, trace, warn};
75}
76
77// Re-export specific macros at root level for backward compatibility or ease of use
78#[cfg(feature = "parser")]
79pub use parser::{bind, define};
80
81#[cfg(feature = "trace")]
82pub use trace::snapshot;
83
84#[cfg(feature = "report")]
85pub use report::help;