aopt_core/lib.rs
1pub mod args;
2pub mod ctx;
3pub mod err;
4pub mod map;
5pub mod opt;
6pub mod parser;
7pub mod str;
8pub mod value;
9
10pub type Uid = u64;
11
12pub use err::Error;
13
14pub type HashMap<K, V> = ahash::HashMap<K, V>;
15
16#[cfg(feature = "sync")]
17pub type ARef<T> = std::sync::Arc<T>;
18#[cfg(not(feature = "sync"))]
19pub type ARef<T> = std::rc::Rc<T>;
20
21#[cfg(feature = "log")]
22pub use tracing::trace;
23#[cfg(not(feature = "log"))]
24#[macro_use]
25pub mod log {
26    #[macro_export]
27    macro_rules! trace {
28        ($($arg:tt)*) => {};
29    }
30}
31
32/// Get the [`TypeId`](std::any::TypeId) of type `T`.
33pub(crate) fn typeid<T: ?Sized + 'static>() -> std::any::TypeId {
34    std::any::TypeId::of::<T>()
35}