macro_rules! MenuVTable_static {
($(#[$meta:meta])* $vis:vis static $ident:ident for $ty:ty) => { ... };
}
Expand description
Instantiate a static MenuVTable for a given type and implements vtable::HasStaticVTable<MenuVTable>
for it.
ⓘ
// The preview above is misleading because of rust-lang/rust#45939, so it is reproduced below
macro_rules! MenuVTable_static {
($(#[$meta:meta])* $vis:vis static $ident:ident for $ty:ty) => { ... }
}
Given a type MyType
that implements the trait Menu
,
create a static variable of type MenuVTable,
and implements HasStaticVTable for it.
ⓘ
struct Foo { ... }
impl Menu for Foo { ... }
MenuVTable_static!(static FOO_VTABLE for Foo);
// now VBox::new can be called
let vbox = VBox::new(Foo{ ... });
Note: Was generated from the #[vtable]
macro on MenuVTable