diff --git a/apb/src/lib.rs b/apb/src/lib.rs index 211c8c44..e689e467 100644 --- a/apb/src/lib.rs +++ b/apb/src/lib.rs @@ -1,4 +1,5 @@ mod macros; +pub(crate) use macros::{strenum, getter, setter}; mod node; pub use node::Node; @@ -6,7 +7,7 @@ pub use node::Node; mod link; pub use link::{Link, LinkMut, LinkType}; -pub mod key; +mod key; pub use key::{PublicKey, PublicKeyMut}; mod base; diff --git a/apb/src/macros.rs b/apb/src/macros.rs index 3350a7b4..e4f787be 100644 --- a/apb/src/macros.rs +++ b/apb/src/macros.rs @@ -17,7 +17,6 @@ impl From for sea_orm::TryGetError { } -#[macro_export] macro_rules! strenum { ( $(pub enum $enum_name:ident { $($flat:ident),* ; $($deep:ident($inner:ident)),* };)+ ) => { $( @@ -95,7 +94,8 @@ macro_rules! strenum { }; } -#[macro_export] +pub(crate) use strenum; + macro_rules! getter { ($name:ident -> type $t:ty) => { fn $name(&self) -> Option<$t> { @@ -192,7 +192,8 @@ macro_rules! getter { }; } -#[macro_export] +pub(crate) use getter; + macro_rules! setter { ($name:ident -> bool) => { paste::item! { @@ -305,6 +306,8 @@ macro_rules! setter { }; } +pub(crate) use setter; + #[cfg(feature = "unstructured")] pub fn set_maybe_node(obj: &mut serde_json::Value, key: &str, node: crate::Node) { match node {