mod.rs (1041B)
1 pub use cgroup::Cgroup; 2 pub use clock::Clock; 3 pub use devfs::DevFs; 4 pub use hostname::Hostname; 5 pub use hwdrivers::HwDrivers; 6 pub use localmount::LocalMount; 7 pub use mdev::MDev; 8 pub use modules::Modules; 9 pub use procfs::ProcFs; 10 pub use rootfs::RootFs; 11 pub use run::Run; 12 pub use seed::Seed; 13 pub use swap::Swap; 14 pub use sysfs::SysFs; 15 16 mod cgroup; 17 mod clock; 18 mod devfs; 19 mod hostname; 20 mod hwdrivers; 21 mod localmount; 22 mod mdev; 23 mod modules; 24 mod procfs; 25 mod rootfs; 26 mod run; 27 mod seed; 28 mod swap; 29 mod sysctl; 30 mod sysfs; 31 32 // deduplication of unit names 33 // as unit names are used as keys and things, having them deduplicated would be good 34 // it also allows comparisons to be O(1) by comparing addresses 35 #[macro_export] 36 macro_rules! unit_name { 37 ($name:literal) => { 38 fn name(&self) -> kanit_unit::UnitName { 39 static NAME: std::sync::OnceLock<kanit_unit::UnitName> = std::sync::OnceLock::new(); 40 41 return NAME 42 .get_or_init(|| kanit_unit::UnitName::from($name)) 43 .clone(); 44 } 45 }; 46 }