sentinel-group/sentinel-rust

Load multiple rules in a single attribute macro

Forsworns opened this issue · 0 comments

Though attribute macro is supplied for easy sentinel construction, it can only wrap a single rule on a single "resource" (method/function). It would be much convenient if multiple rules can be defined in a single attribute macro.

Both parsing and design of this attribute macro bother me. I'm considering the following two potential formats, which are compatible with current attributes:

#[flow(...), flow(...), system(...)]
fn task()->u32{ 0 }
#[flow(...)]
#[flow(...)]
#[system(...)]
fn task()->u32{ 0 }

Either of them should load three rules (vec![flow::Rule, flow::Rule, system::Rule) on the method task().