FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    AppLocator

    struct · ferroui-splat · v0.5.0

    struct AppLocator
    

    The service locator of the application (AppLocator): the current resolver, which applications and libraries resolve their services from, and the notifications of its changes.

    It starts with an empty InstanceGenericFirstDependencyResolver; set_locator replaces it.

    View source

    Members

    current

    fn current() -> Rc<dyn IReadonlyDependencyResolver>
    

    The current resolver, to resolve services from (Current).

    Source

    current_mutable

    fn current_mutable() -> Rc<dyn IMutableDependencyResolver>
    

    The current resolver, to register services with (CurrentMutable).

    Source

    register_resolver_initializer

    fn register_resolver_initializer(initializer: impl Fn(&dyn IMutableDependencyResolver) -> () + 'static)
    

    Sets what the locator runs on every new resolver (RegisterResolverInitializer); it replaces the previous initializer.

    Source

    set_locator

    fn set_locator(dependency_resolver: Rc<dyn IDependencyResolver>)
    

    Makes dependency_resolver the current resolver and notifies the callbacks (SetLocator).

    Source

    get_locator

    fn get_locator() -> Rc<dyn IDependencyResolver>
    

    The current resolver (GetLocator).

    Source

    register_resolver_callback_changed

    fn register_resolver_callback_changed(callback: impl Fn() -> () + 'static) -> Rc<dyn IDisposable>
    

    Calls callback now, while notifications are enabled, and whenever the resolver changes, until the returned disposable is disposed (RegisterResolverCallbackChanged).

    Source

    suppress_resolver_callback_changed_notifications

    fn suppress_resolver_callback_changed_notifications() -> Rc<dyn IDisposable>
    

    Suppresses the notifications of the changes of the resolver until the returned disposable is disposed (SuppressResolverCallbackChangedNotifications).

    Source

    are_resolver_callback_changed_notifications_enabled

    fn are_resolver_callback_changed_notifications_enabled() -> bool
    

    AreResolverCallbackChangedNotificationsEnabled.

    Source

    get_service

    fn get_service<S: ?Sized + 'static>() -> Option<Rc<S>>
    

    GetService<T>() of the current resolver.

    Source

    get_service_with_contract

    fn get_service_with_contract<S: ?Sized + 'static>(contract: &str) -> Option<Rc<S>>
    

    GetService<T>(string contract) of the current resolver.

    Source

    get_services

    fn get_services<S: ?Sized + 'static>() -> Vec<Rc<S>>
    

    GetServices<T>() of the current resolver.

    Source

    get_services_with_contract

    fn get_services_with_contract<S: ?Sized + 'static>(contract: &str) -> Vec<Rc<S>>
    

    GetServices<T>(string contract) of the current resolver.

    Source

    has_registration

    fn has_registration<S: ?Sized + 'static>() -> bool
    

    HasRegistration<T>() of the current resolver.

    Source

    has_registration_with_contract

    fn has_registration_with_contract<S: ?Sized + 'static>(contract: &str) -> bool
    

    HasRegistration<T>(string contract) of the current resolver.

    Source

    register

    fn register<S: ?Sized + 'static>(factory: impl Fn() -> Option<Rc<S>> + 'static)
    

    Register<T>(Func<T?>) with the current resolver.

    Source

    register_with_contract

    fn register_with_contract<S: ?Sized + 'static>(factory: impl Fn() -> Option<Rc<S>> + 'static, contract: &str)
    

    Register<T>(Func<T?>, string contract) with the current resolver.

    Source

    register_constant

    fn register_constant<S: ?Sized + 'static>(value: Rc<S>)
    

    RegisterConstant<T>(T) with the current resolver.

    Source

    register_constant_with_contract

    fn register_constant_with_contract<S: ?Sized + 'static>(value: Rc<S>, contract: &str)
    

    RegisterConstant<T>(T, string contract) with the current resolver.

    Source

    register_lazy_singleton

    fn register_lazy_singleton<S: ?Sized + 'static>(factory: impl Fn() -> Option<Rc<S>> + 'static)
    

    RegisterLazySingleton<T>(Func<T?>) with the current resolver.

    Source

    register_lazy_singleton_with_contract

    fn register_lazy_singleton_with_contract<S: ?Sized + 'static>(factory: impl Fn() -> Option<Rc<S>> + 'static, contract: &str)
    

    RegisterLazySingleton<T>(Func<T?>, string contract) with the current resolver.

    Source

    unregister_current

    fn unregister_current<S: ?Sized + 'static>()
    

    UnregisterCurrent<T>() of the current resolver.

    Source

    unregister_current_with_contract

    fn unregister_current_with_contract<S: ?Sized + 'static>(contract: &str)
    

    UnregisterCurrent<T>(string contract) of the current resolver.

    Source

    unregister_all

    fn unregister_all<S: ?Sized + 'static>()
    

    UnregisterAll<T>() of the current resolver.

    Source

    unregister_all_with_contract

    fn unregister_all_with_contract<S: ?Sized + 'static>(contract: &str)
    

    UnregisterAll<T>(string contract) of the current resolver.

    Source

    Trait implementations

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

    Availability

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