// TODO(https://fxbug.dev/61861): This parallel implementation of component manager's builtin environment
// setup will do for now, but is fragile and should be replaced soon. In particular, it doesn't provide a
// way to register builtin runners or resolvers that appear in the `builtin_capabilities` field of the
// RuntimeConfig but are not one of these hard-coded built-ins.
This parallel implementation of component manager's builtin environment
setup will do for now, but is fragile and should be replaced soon. In particular, it doesn't provide a
way to register builtin runners or resolvers that appear in the `builtin_capabilities` field of the
RuntimeConfig but are not one of these hard-coded built-ins.
This parallel implementation of component manager ' s builtin environment setup will do for now but is fragile and should be replaced soon . In particular it doesn ' t provide a way to register builtin runners or resolvers that appear in the ` builtin_capabilities ` field of the RuntimeConfig but are not one of these hard - coded built - ins .
fn build_root_environment(
        &self,
        runtime_config: &Arc<RuntimeConfig>,
        runner_registry: RunnerRegistry,
    ) -> NodeEnvironment {
        let mut resolver_registry = ResolverRegistry::default();
        // Register the boot resolver, if any
        match runtime_config.builtin_boot_resolver {
            component_internal::BuiltinBootResolver::Boot => {
                assert!(
                    resolver_registry
                        .register(&ResolverRegistration {
                            resolver: BOOT_RESOLVER_NAME.into(),
                            source: RegistrationSource::Self_,
                            scheme: BOOT_SCHEME.to_string(),
                        })
                        .is_none(),
                    "found duplicate resolver for boot scheme"
                );
            }
            component_internal::BuiltinBootResolver::Pkg => {
                assert!(
                    resolver_registry
                        .register(&ResolverRegistration {
                            resolver: PKG_RESOLVER_NAME.into(),
                            source: RegistrationSource::Self_,
                            scheme: PKG_SCHEME.to_string(),
                        })
                        .is_none(),
                    "found duplicate resolver for pkg scheme"
                );
            }
            component_internal::BuiltinBootResolver::None => {}
        };
        // Register the RealmBuilder resolver and runner, if any
        match runtime_config.realm_builder_resolver_and_runner {
            component_internal::RealmBuilderResolverAndRunner::Namespace => {
                assert!(
                    resolver_registry
                        .register(&ResolverRegistration {
                            resolver: REALM_BUILDER_RESOLVER_NAME.into(),
                            source: RegistrationSource::Self_,
                            scheme: REALM_BUILDER_SCHEME.to_string(),
                        })
                        .is_none(),
                    "found duplicate resolver for realm builder scheme"
                );
            }
            component_internal::RealmBuilderResolverAndRunner::None => {}
        }
        NodeEnvironment::new_root(runner_registry, resolver_registry, DebugRegistry::default())
    }
fn build_root_environment ( & self , runtime_config : & Arc < RuntimeConfig > , runner_registry : RunnerRegistry , ) -> NodeEnvironment { let mut resolver_registry = ResolverRegistry :: default ( ) ; // Register the boot resolver, if any match runtime_config . builtin_boot_resolver { component_internal :: BuiltinBootResolver :: Boot => { assert ! ( resolver_registry register ( ResolverRegistration { resolver BOOT_RESOLVER_NAME into ( ) source RegistrationSource Self_ scheme BOOT_SCHEME to_string ( ) } ) is_none ( ) " " ) ; } component_internal :: BuiltinBootResolver :: Pkg => { assert ! ( resolver_registry register ( ResolverRegistration { resolver PKG_RESOLVER_NAME into ( ) source RegistrationSource Self_ scheme PKG_SCHEME to_string ( ) } ) is_none ( ) " " ) ; } component_internal :: BuiltinBootResolver :: None => { } } ; // Register the RealmBuilder resolver and runner, if any match runtime_config . realm_builder_resolver_and_runner { component_internal :: RealmBuilderResolverAndRunner :: Namespace => { assert ! ( resolver_registry register ( ResolverRegistration { resolver REALM_BUILDER_RESOLVER_NAME into ( ) source RegistrationSource Self_ scheme REALM_BUILDER_SCHEME to_string ( ) } ) is_none ( ) " " ) ; } component_internal :: RealmBuilderResolverAndRunner :: None => { } } NodeEnvironment :: new_root ( runner_registry , resolver_registry , DebugRegistry :: default ( ) ) }
TODO(https://fxbug.dev/61861): This parallel implementation of component manager's builtin environment
setup will do for now, but is fragile and should be replaced soon.
TODO ( https : // fxbug . dev / 61861 ) : This parallel implementation of component manager ' s builtin environment setup will do for now but is fragile and should be replaced soon .
&self
runtime_config
&Arc<RuntimeConfig>
runner_registry
RunnerRegistry