FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    DefaultConstructible

    trait · ferroui-base · v0.5.0

    trait DefaultConstructible: ObjectType
    

    A class with a default constructor: the new part of ferro_class_info!, reached through the type rather than through its TypeInfo.

    Generic code that creates an instance of a class it names statically (PageType::of::<T>() of ferroui-controls) calls this, so the compiler checks that the class has a default constructor, and the constructor is linked only where something creates the class (#612). Implemented by ferro_class_info! for every class that declares new. It works with and without the tables of types; the constructor a TypeInfo carries (TypeInfo::default_constructor) exists only with them.

    View source

    Members

    new_instance

    fn new_instance() -> Ref<Self>
    

    Creates an instance as the parameterless new() of the class does.

    Source

    Trait implementations

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.