FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ViewModelType

    struct · ferroui-reactiveui · v0.5.0

    struct ViewModelType
    

    The compile-time type of a view model, as a value (what upstream's TViewModel gives a generic resolution): its TypeId, its name, and how to ask the service locator for its view (IViewFor<TViewModel>, here dyn IViewForOf<VM>).

    Not an upstream type: Rust cannot close IViewFor<> over a type known only at run time (MakeGenericType), so the lookup is made where the type is known, by of.

    View source

    Members

    of

    fn of<VM: 'static>() -> Self
    

    The type VM.

    Source

    id

    fn id(self: &Self) -> TypeId
    

    The TypeId of the type.

    Source

    type_name

    fn type_name(self: &Self) -> &'static str
    

    The name of the type (Type.Name, here the path of the type).

    Source

    service_view

    fn service_view(self: &Self, contract: Option<&str>) -> Option<Rc<dyn IViewFor>>
    

    The last view registered in the service locator as dyn IViewForOf<VM> under contract (None and an empty contract are the default registration), or None (AppLocator.Current.GetService<IViewFor<TViewModel>>(contract)).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • Clone
    • Copy
    • Debug
    • PartialEq
    • Eq

    Availability

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