Skip to main content

ferro_static_type

Macro ferro_static_type 

Source
macro_rules! ferro_static_type {
    ($name:ident) => { ... };
}
Expand description

Declares the runtime type of a type that is not a class: a type that owns attached properties and cannot be instantiated as an object.

ⓘ
pub struct KeyboardNavigation;
ferro_static_type!(KeyboardNavigation);

ferro_properties! {
    impl KeyboardNavigation {
        pub fn tab_index_property() -> AttachedProperty<i32> { .. }
    }
}

Unlike a hand-written impl StaticType, the runtime type carries the static initialisation of the type (its ferro_properties! block and its fn static_constructor(), as for a class), so its properties are found by owner type and name before any accessor was called, and it knows its module, hence its namespace.