Skip to main content

Model

Trait Model 

Source
pub trait Model:
    PartialEq
    + Sized
    + 'static {
    // Required method
    fn describe(builder: ModelTypeBuilder<Self>) -> ModelTypeBuilder<Self>;

    // Provided methods
    fn register() { ... }
    fn new_model(value: Self) -> Rc<Self> { ... }
}
Expand description

A model type that declares its binding metadata.

Implement it with ferro_model!; create instances with Model::new_model (or call Model::register once per thread before the first binding touches an instance).

Required Methods§

Source

fn describe(builder: ModelTypeBuilder<Self>) -> ModelTypeBuilder<Self>

Describes the type’s properties, methods and notification interfaces.

Provided Methods§

Source

fn register()

Registers the metadata on the current thread, once.

Source

fn new_model(value: Self) -> Rc<Self>

Wraps an instance into its shared, bindable form.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§