Macro sixtyfps_corelib::ComponentVTable_static [−][src]
macro_rules! ComponentVTable_static { ($(#[$meta : meta]) * $vis : vis static $ident : ident for $ty : ty) => { ... }; }
Expand description
Instantiate a static ComponentVTable for a given type and implements vtable::HasStaticVTable<ComponentVTable>
for it.
ⓘ
// The preview above is misleading because of rust-lang/rust#45939, so it is reproduced below macro_rules! ComponentVTable_static { ($(#[$meta:meta])* $vis:vis static $ident:ident for $ty:ty) => { ... } }
Given a type MyType
that implements the trait Component
,
create a static variable of type ComponentVTable,
and implements HasStaticVTable for it.
ⓘ
struct Foo { ... } impl Component for Foo { ... } ComponentVTable_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 ComponentVTable