behavior

Attribute Macro behavior 

Source
#[behavior]
Expand description

Check whether the modules have functions with the same signature as the counterparts of behavior trait.

§Example

#[behavior::behavior(modules(en, ja))]
trait Behavior {
    fn greeting() -> &'static str;
}

mod en {
    pub fn greeting() -> &'static str {
        "hello"
    }
}

mod ja {
    pub fn greeting() -> &'static str {
        "こんにちは"
    }
}

#[cfg(feature = "en")]
pub use en::*;

#[cfg(all(not(feature = "en"), feature = "ja"))]
pub use ja::*;