FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IRegistrar

    trait · ferroui-reactiveui · v0.5.0

    trait IRegistrar
    

    Registers services with a dependency injection container without reflection (IRegistrar): what an IWantsToRegisterStuff registers its services with.

    Deviation (DEVIATIONS.md, ReactiveUI): upstream's methods are generic in the type of the service; a trait object cannot have generic methods, so the trait has the methods of the erased services, keyed by their ServiceType, as Splat's resolvers do, and the generic methods of upstream are those of RegistrarExt, which every registrar has.

    View source

    Members

    register_constant_erased

    fn register_constant_erased(self: &Self, factory: Box<dyn FnOnce() -> ErasedService>, service_type: ServiceType, contract: Option<&str>)
    

    Registers the value that factory creates, once, as a constant of service_type (RegisterConstant<TService>(Func<TService>, string?)).

    Source

    register_lazy_singleton_erased

    fn register_lazy_singleton_erased(self: &Self, factory: ServiceFactory, service_type: ServiceType, contract: Option<&str>)
    

    Registers factory as a lazy singleton of service_type: it creates the value the first time it is resolved (RegisterLazySingleton<TService>(Func<TService>, string?)).

    Source

    register_erased

    fn register_erased(self: &Self, factory: ServiceFactory, service_type: ServiceType, contract: Option<&str>)
    

    Registers factory, which creates a value each time service_type is resolved (Register<TService>(Func<TService>, string?)).

    Source

    Trait implementations

    Availability

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