drogue_bazaar/core/
info.rs1pub struct ProjectInformation {
3 pub name: &'static str,
5 pub version: &'static str,
7 pub banner: &'static str,
9}
10
11pub struct ComponentInformation {
13 pub project: &'static ProjectInformation,
15 pub name: &'static str,
17 pub version: &'static str,
19 pub description: &'static str,
21}
22
23#[macro_export]
31macro_rules! project {
32 ($name:literal) => {
33 $crate::project!(PROJECT: $name);
34 };
35 ($v:ident: $name:literal) => {
36 $crate::project!($v: $name => r#"______ ______ _____ _____ _ _ _____ _____ _____
37| _ \| ___ \| _ || __ \| | | || ___| |_ _| |_ _|
38| | | || |_/ /| | | || | \/| | | || |__ | | ___ | |
39| | | || / | | | || | __ | | | || __| | | / _ \ | |
40| |/ / | |\ \ \ \_/ /| |_\ \| |_| || |___ _| |_ | (_) | | |
41|___/ \_| \_| \___/ \____/ \___/ \____/ \___/ \___/ \_/
42"# );
43 };
44 ($v:ident: $name:expr => $banner:expr) => {
45 pub const $v: $crate::core::info::ProjectInformation =
46 $crate::core::info::ProjectInformation {
47 name: $name,
48 version: env!("CARGO_PKG_VERSION"),
49 banner: $banner,
50 };
51 };
52}
53
54#[macro_export]
59macro_rules! component {
60 ($project:expr) => {
61 $crate::core::info::ComponentInformation {
62 project: &$project,
63 name: env!("CARGO_PKG_NAME"),
64 version: env!("CARGO_PKG_VERSION"),
65 description: env!("CARGO_PKG_DESCRIPTION"),
66 }
67 };
68 ($v:ident, $project:expr) => {
69 pub const $v: $crate::core::info::ComponentInformation = $crate::component!($project);
70 };
71}