FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ViewRegistrar

    struct · ferroui-reactiveui-controls · v0.5.0

    struct ViewRegistrar
    

    Registers the views of assemblies with a dependency resolver (ViewRegistrar).

    A view is registered as IViewFor<TViewModel> of the view model it implements, under the contract it declares. Resolution prefers the service locator and falls back to the constructor, so a view with no registration of its own is still constructible.

    View source

    Members

    register_views

    fn register_views(resolver: Option<&dyn IMutableDependencyResolver>, assemblies: Option<&[Rc<ViewAssembly>]>)
    

    Registers the views of assemblies with resolver when both are available (RegisterViews).

    Source

    register_views_internal

    fn register_views_internal(resolver: &dyn IMutableDependencyResolver, assemblies: &[Rc<ViewAssembly>])
    

    Registers every view of assemblies that is neither abstract nor an interface (RegisterViewsInternal). An assembly given twice is registered once.

    Source

    find_view_for_interface

    fn find_view_for_interface(view_type: &ViewAssemblyType) -> Option<&std::rc::Rc<dyn Fn(&dyn IMutableDependencyResolver) -> ()>>
    

    The registration of IViewFor<TViewModel> of a type, None when the type is not a view (FindViewForInterface).

    Source

    get_view_contract

    fn get_view_contract(view_type: &ViewAssemblyType) -> Option<&str>
    

    The contract a view declares, None for the default (GetViewContract).

    Source

    create_view

    fn create_view<V: 'static>(activator: fn() -> Rc<V>) -> Rc<V>
    

    Resolves a view of type V from the service locator, or creates it with activator (CreateView). A failure of the locator is logged and falls back to the constructor.

    Source

    create_view_after_resolution_failure

    fn create_view_after_resolution_failure<V: 'static>(activator: fn() -> Rc<V>, error: &str) -> Rc<V>
    

    Logs a failure of the service locator and creates the view with its constructor (CreateViewAfterResolutionFailure).

    Source

    create_view_with_activator

    fn create_view_with_activator<V: 'static>(activator: fn() -> Rc<V>) -> Rc<V>
    

    Creates the view with its constructor (CreateViewWithActivator).

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ClassDefaults
    • ErasedDestructor
    • IntoEither

    Availability

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