macro_rules! vmt {
    (
        $var:ident => [
            $($fn:ident),*
        ]
    ) => { ... };
}
Expand description

Creates a virtual method table.

Behaviour

Each time macro is used, it will create new virtual method table via Box::leak.

fn first() {
    println!("First");
}
fn second() {
    println!("Second");
}

let vmt = vmt! {
    first,
    second
};