pub fn new<P>(
        dynamic_configs_path: Option<P>,
        amber: A,
        experiments: Experiments,
    ) -> Result<Self, (Self, LoadError)>
    where
        P: Into<PathBuf>,
    {
        let dynamic_configs_path = dynamic_configs_path.map(|p| p.into());

        let (dynamic_configs, err) = match dynamic_configs_path {
            Some(ref dynamic_configs_path) if dynamic_configs_path.exists() => {
                match load_configs_file(dynamic_configs_path) {
                    Ok(dynamic_configs) => (dynamic_configs, None),
                    Err(err) => (vec![], Some(err)),
                }
            }
            _ => (vec![], None),
        };

        let builder = RepositoryManagerBuilder {
            dynamic_configs_path,
            static_configs: HashMap::new(),
            dynamic_configs: dynamic_configs
                .into_iter()
                .map(|config| (config.repo_url().clone(), Arc::new(config)))
                .collect(),
            amber,
            experiments,
            inspect_node: UnsetInspectNode,
        };

        if let Some(err) = err {
            Err((builder, err))
        } else {
            Ok(builder)
        }
    }
/// Create a new builder and initialize it with the dynamic
/// [RepositoryConfigs](RepositoryConfig) from this path if it exists, and add it to the
/// [RepositoryManager], or error out if we encounter errors during the load. The
/// [RepositoryManagerBuilder] is also returned on error in case the errors should be ignored.
Create a new builder and initialize it with the dynamic
[RepositoryConfigs](RepositoryConfig) from this path if it exists, and add it to the
[RepositoryManager], or error out if we encounter errors during the load. The
[RepositoryManagerBuilder] is also returned on error in case the errors should be ignored.
Create a new builder and initialize it with the dynamic [ RepositoryConfigs ] ( RepositoryConfig ) from this path if it exists and add it to the [ RepositoryManager ] or error out if we encounter errors during the load . The [ RepositoryManagerBuilder ] is also returned on error in case the errors should be ignored .
pub fn new<P>(
        dynamic_configs_path: Option<P>,
        amber: A,
        experiments: Experiments,
    ) -> Result<Self, (Self, LoadError)>
    where
        P: Into<PathBuf>,
    {
        let dynamic_configs_path = dynamic_configs_path.map(|p| p.into());
        let (dynamic_configs, err) = match dynamic_configs_path {
            Some(ref dynamic_configs_path) if dynamic_configs_path.exists() => {
                match load_configs_file(dynamic_configs_path) {
                    Ok(dynamic_configs) => (dynamic_configs, None),
                    Err(err) => (vec![], Some(err)),
                }
            }
            _ => (vec![], None),
        };
        let builder = RepositoryManagerBuilder {
            dynamic_configs_path,
            static_configs: HashMap::new(),
            dynamic_configs: dynamic_configs
                .into_iter()
                .map(|config| (config.repo_url().clone(), Arc::new(config)))
                .collect(),
            amber,
            experiments,
            inspect_node: UnsetInspectNode,
        };
        if let Some(err) = err {
            Err((builder, err))
        } else {
            Ok(builder)
        }
    }
pub fn new < P > ( dynamic_configs_path : Option < P > , amber : A , experiments : Experiments , ) -> Result < Self , ( Self , LoadError ) > where P : Into < PathBuf > , { let dynamic_configs_path = dynamic_configs_path . map ( | p | p . into ( ) ) ; let ( dynamic_configs , err ) = match dynamic_configs_path { Some ( ref dynamic_configs_path ) if dynamic_configs_path . exists ( ) => { match load_configs_file ( dynamic_configs_path ) { Ok ( dynamic_configs ) => ( dynamic_configs , None ) , Err ( err ) => ( vec ! [ ] , Some ( err ) ) , } } _ => ( vec ! [ ] , None ) , } ; let builder = RepositoryManagerBuilder { dynamic_configs_path , static_configs : HashMap :: new ( ) , dynamic_configs : dynamic_configs . into_iter ( ) . map ( | config | ( config . repo_url ( ) . clone ( ) , Arc :: new ( config ) ) ) . collect ( ) , amber , experiments , inspect_node : UnsetInspectNode , } ; if let Some ( err ) = err { Err ( ( builder , err ) ) } else { Ok ( builder ) } }
Create a new builder and initialize it with the dynamic
[RepositoryConfigs](RepositoryConfig) from this path if it exists, and add it to the
[RepositoryManager], or error out if we encounter errors during the load.
Create a new builder and initialize it with the dynamic [ RepositoryConfigs ] ( RepositoryConfig ) from this path if it exists and add it to the [ RepositoryManager ] or error out if we encounter errors during the load .
dynamic_configs_path
Option<P>
amber
A
experiments
Experiments