macro_rules! gen_id {
($idx:expr) => { ... };
($idx:expr, $i:expr) => { ... };
}
Expand description
While the ID scope provides a .next() method to generate a new, unique ID, this macro allows you to generate a unique ID with the file name and line embedded in it. This helps when debugging, because it’ll tell you exactly what line of code generated the element causing the problem.
§Examples:
use feather_ui::{gen_id, ScopeID};
fn app(id: &mut ScopeID) {
let unique_id = gen_id!(id); // unique_id now contains the source location where gen_id! was invoked.
}