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.
Members
register_viewsregister_views_internalfind_view_for_interfaceget_view_contractcreate_viewcreate_view_after_resolution_failurecreate_view_with_activator
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).
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.
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).
get_view_contract
fn get_view_contract(view_type: &ViewAssemblyType) -> Option<&str>
The contract a view declares, None for the default (GetViewContract).
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.
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).
create_view_with_activator
fn create_view_with_activator<V: 'static>(activator: fn() -> Rc<V>) -> Rc<V>
Creates the view with its constructor (CreateViewWithActivator).
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>Into<U>From<T>TryInto<U>TryFrom<U>AnyClassDefaultsErasedDestructorIntoEither
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.