[][src]Trait fui_core::ViewModel

pub trait ViewModel {
    fn create_view(
        view_model: &Rc<RefCell<Self>>
    ) -> Rc<RefCell<dyn ControlObject>>; }

Used to convert controls to views. Controls can be consumed during conversion.

Used to convert view models to views.

This is a trait with static methods. In Rust 2018 you cannot use Rc<RefCell> as a self type (feature: arbitrary self types). Rc could work but it would give us more troubles with handling mutable state in View Models. So we use static methods here but we declare additional ViewModelObject trait which is an object safe trait.

Required methods

fn create_view(view_model: &Rc<RefCell<Self>>) -> Rc<RefCell<dyn ControlObject>>

Loading content...

Implementors

Loading content...