Crate unistore_macros

Crate unistore_macros 

Source
Expand description

unistore-macros - Procedural macros for unistore framework

提供 #[derive(Event)] 等宏,简化事件和组件定义。

§示例

use unistore::sdk::events::Event;
use unistore_macros::Event;

#[derive(Clone, Event)]
struct OrderCreated {
    order_id: u64,
    amount: f64,
}

// 自定义事件名称
#[derive(Clone, Event)]
#[event(name = "user.logged_in")]
struct UserLoggedIn {
    user_id: u64,
}

Derive Macros§

Event
派生 Event trait 的宏