FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IWantsToRegisterStuff

    trait · ferroui-reactiveui · v0.5.0

    trait IWantsToRegisterStuff
    

    A type that registers services with ReactiveUI's dependency resolver (IWantsToRegisterStuff), through the builder:

    use ferroui_reactiveui::{IRegistrar, IWantsToRegisterStuff, RegistrarExt};
    use std::rc::Rc;
    
    struct Greeting(&'static str);
    
    struct MyRegistrations;
    
    impl IWantsToRegisterStuff for MyRegistrations {
        fn register(&self, registrar: &dyn IRegistrar) {
            registrar.register_constant(|| Rc::new(Greeting("hello")));
        }
    }
    

    Assembly scanning, which upstream used to find these types, is not ported (reflection); a builder is given them with with_registration or with_platform_module.

    View source

    Members

    register

    fn register(self: &Self, registrar: &dyn IRegistrar)
    

    Registers the services with registrar (Register(IRegistrar)).

    Source

    Trait implementations

    Availability

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