macro_rules! port {
($mod:ident) => { ... };
($mod:ident as $name:ident) => { ... };
($outer:ident::$inner:ident) => { ... };
($outer:ident::$inner:ident as $name:ident) => { ... };
($outer:ident: [$($inner:ident,)+]) => { ... };
($outer:ident: [$($inner:ident as $name:ident)+,]) => { ... };
}
Expand description
Define and export a specific port module (transparently pulls its namespace to the current one).
Used mostly to conveniently fit the module declaration and reexport under a single configuration flag.
Example
ⓘ
#[cfg(feature = "stm32_any")]
port!(stm32);
// Expands into:
pub mod stm32;
pub use self::stm32::*;
#[cfg(feature = "stm32_any")]
port!(stm32::flash as mcu_flash);
// Expands into:
pub mod stm32 { pub mod flash };
pub use self::stm32::flash as mcu_flash;