pub fn remove(
        &mut self,
        repo_url: &RepoUrl,
    ) -> Result<Option<Arc<RepositoryConfig>>, RemoveError> {
        let dynamic_configs_path =
            self.dynamic_configs_path.as_ref().ok_or(RemoveError::DynamicConfigurationDisabled)?;

        if let Some(config) = self.dynamic_configs.remove(repo_url) {
            // Clear any connections so we aren't talking to stale repositories.
            let connected_to_amber = self.amber_conns.write().remove(config.repo_url()).is_some();
            let connected_to_rust_tuf =
                self.rust_tuf_conns.write().remove(config.repo_url()).is_some();
            if connected_to_amber || connected_to_rust_tuf {
                fx_log_info!(
                    "closing connection to {} repo because config removed",
                    config.repo_url()
                );
            }

            Self::save(&dynamic_configs_path, &mut self.dynamic_configs);
            return Ok(Some(Arc::clone(&*config)));
        }
        if self.static_configs.get(repo_url).is_some() {
            Err(RemoveError::CannotRemoveStaticRepositories)
        } else {
            Ok(None)
        }
    }
/// Removes a [RepositoryConfig] identified by the config `repo_url`.
///
/// If dynamic configuration is disabled (if the manager does not have a dynamic config path)
/// `Err(RemoveError)` is returned.
Removes a [RepositoryConfig] identified by the config `repo_url`.
If dynamic configuration is disabled (if the manager does not have a dynamic config path)
`Err(RemoveError)` is returned.
Removes a [ RepositoryConfig ] identified by the config ` repo_url ` . If dynamic configuration is disabled ( if the manager does not have a dynamic config path ) ` Err ( RemoveError ) ` is returned .
pub fn remove(
        &mut self,
        repo_url: &RepoUrl,
    ) -> Result<Option<Arc<RepositoryConfig>>, RemoveError> {
        let dynamic_configs_path =
            self.dynamic_configs_path.as_ref().ok_or(RemoveError::DynamicConfigurationDisabled)?;
        if let Some(config) = self.dynamic_configs.remove(repo_url) {
            // Clear any connections so we aren't talking to stale repositories.
            let connected_to_amber = self.amber_conns.write().remove(config.repo_url()).is_some();
            let connected_to_rust_tuf =
                self.rust_tuf_conns.write().remove(config.repo_url()).is_some();
            if connected_to_amber || connected_to_rust_tuf {
                fx_log_info!(
                    "closing connection to {} repo because config removed",
                    config.repo_url()
                );
            }
            Self::save(&dynamic_configs_path, &mut self.dynamic_configs);
            return Ok(Some(Arc::clone(&*config)));
        }
        if self.static_configs.get(repo_url).is_some() {
            Err(RemoveError::CannotRemoveStaticRepositories)
        } else {
            Ok(None)
        }
    }
pub fn remove ( & mut self , repo_url : & RepoUrl , ) -> Result < Option < Arc < RepositoryConfig > > , RemoveError > { let dynamic_configs_path = self . dynamic_configs_path . as_ref ( ) . ok_or ( RemoveError :: DynamicConfigurationDisabled ) ? ; if let Some ( config ) = self . dynamic_configs . remove ( repo_url ) { // Clear any connections so we aren't talking to stale repositories. let connected_to_amber = self . amber_conns . write ( ) . remove ( config . repo_url ( ) ) . is_some ( ) ; let connected_to_rust_tuf = self . rust_tuf_conns . write ( ) . remove ( config . repo_url ( ) ) . is_some ( ) ; if connected_to_amber || connected_to_rust_tuf { fx_log_info ! ( " " config repo_url ( ) ) ; } Self :: save ( & dynamic_configs_path , & mut self . dynamic_configs ) ; return Ok ( Some ( Arc :: clone ( & * config ) ) ) ; } if self . static_configs . get ( repo_url ) . is_some ( ) { Err ( RemoveError :: CannotRemoveStaticRepositories ) } else { Ok ( None ) } }
Removes a [RepositoryConfig] identified by the config `repo_url`.
Removes a [ RepositoryConfig ] identified by the config ` repo_url ` .
&mut self
repo_url
&RepoUrl