/// Returns a ResolverRegistry configured with the component resolvers available to the current
/// process.
Returns a ResolverRegistry configured with the component resolvers available to the current
process.
Returns a ResolverRegistry configured with the component resolvers available to the current process .
pub fn available_resolvers(
    model_for_resolver: Arc<Mutex<Option<Weak<Model>>>>,
) -> Result<ResolverRegistry, Error> {
    let mut resolver_registry = ResolverRegistry::new();
    // Either the fuchsia-boot or fuchsia-pkg resolver may be unavailable in certain contexts.
    let boot_resolver = FuchsiaBootResolver::new().context("Failed to create boot resolver")?;
    match boot_resolver {
        None => info!("No /boot directory in namespace, fuchsia-boot resolver unavailable"),
        Some(r) => {
            resolver_registry.register(fuchsia_boot_resolver::SCHEME.to_string(), Box::new(r));
        }
    };
    if let Some(loader) = connect_sys_loader()? {
        resolver_registry.register(
            fuchsia_pkg_resolver::SCHEME.to_string(),
            Box::new(fuchsia_pkg_resolver::FuchsiaPkgResolver::new(loader)),
        );
    } else {
        resolver_registry.register(
            fuchsia_base_pkg_resolver::SCHEME.to_string(),
            Box::new(fuchsia_base_pkg_resolver::FuchsiaPkgResolver::new(model_for_resolver)),
        );
    }
    Ok(resolver_registry)
}
pub fn available_resolvers ( model_for_resolver : Arc < Mutex < Option < Weak < Model > > > > , ) -> Result < ResolverRegistry , Error > { let mut resolver_registry = ResolverRegistry :: new ( ) ; // Either the fuchsia-boot or fuchsia-pkg resolver may be unavailable in certain contexts. let boot_resolver = FuchsiaBootResolver :: new ( ) . context ( " " ) ? ; match boot_resolver { None => info ! ( " " ) , Some ( r ) => { resolver_registry . register ( fuchsia_boot_resolver :: SCHEME . to_string ( ) , Box :: new ( r ) ) ; } } ; if let Some ( loader ) = connect_sys_loader ( ) ? { resolver_registry . register ( fuchsia_pkg_resolver :: SCHEME . to_string ( ) , Box :: new ( fuchsia_pkg_resolver :: FuchsiaPkgResolver :: new ( loader ) ) , ) ; } else { resolver_registry . register ( fuchsia_base_pkg_resolver :: SCHEME . to_string ( ) , Box :: new ( fuchsia_base_pkg_resolver :: FuchsiaPkgResolver :: new ( model_for_resolver ) ) , ) ; } Ok ( resolver_registry ) }
Returns a ResolverRegistry configured with the component resolvers available to the current
process.
Returns a ResolverRegistry configured with the component resolvers available to the current process .
model_for_resolver
Arc<Mutex<Option<Weak<Model>>>>