pub fn new_with_spu(
        sc_host_port: Option<String>,
        spu_host_port: Option<String>,
        kf_host_port: Option<String>,
        profile_name: Option<String>,
    ) -> Result<Self, ClientError> {

        debug!("looking up spu using sc: {:#?}, spu: {:#?}, kf: {:#?}, profile: {:#?}",
            sc_host_port,
            spu_host_port,
            kf_host_port,
            profile_name);

        // build profile config from cli parameters
        let cli_config = Self::from_cli(sc_host_port, spu_host_port, kf_host_port)?;

        let profile_config = if cli_config.valid_servers_or_error().is_ok() {
            debug!("one server address is found");
            cli_config
        } else {
            debug!("no server address found, looking from profile");
            // build profile config from profile file
            let mut file_config = match profile_name {
                Some(profile) => ProfileConfig::config_from_custom_profile(profile)?,
                None => ProfileConfig::config_from_default_profile()?,
            };

            // merge the profiles (cli takes precedence)
            file_config.merge_with(&cli_config);
            file_config
        };

        profile_config.valid_servers_or_error()?;

        Ok(profile_config)
    }
/// generate profile configuration with spu based on a default or custom profile file
generate profile configuration with spu based on a default or custom profile file
generate profile configuration with spu based on a default or custom profile file
pub fn new_with_spu(
        sc_host_port: Option<String>,
        spu_host_port: Option<String>,
        kf_host_port: Option<String>,
        profile_name: Option<String>,
    ) -> Result<Self, ClientError> {
        debug!("looking up spu using sc: {:#?}, spu: {:#?}, kf: {:#?}, profile: {:#?}",
            sc_host_port,
            spu_host_port,
            kf_host_port,
            profile_name);
        // build profile config from cli parameters
        let cli_config = Self::from_cli(sc_host_port, spu_host_port, kf_host_port)?;
        let profile_config = if cli_config.valid_servers_or_error().is_ok() {
            debug!("one server address is found");
            cli_config
        } else {
            debug!("no server address found, looking from profile");
            // build profile config from profile file
            let mut file_config = match profile_name {
                Some(profile) => ProfileConfig::config_from_custom_profile(profile)?,
                None => ProfileConfig::config_from_default_profile()?,
            };
            // merge the profiles (cli takes precedence)
            file_config.merge_with(&cli_config);
            file_config
        };
        profile_config.valid_servers_or_error()?;
        Ok(profile_config)
    }
pub fn new_with_spu ( sc_host_port : Option < String > , spu_host_port : Option < String > , kf_host_port : Option < String > , profile_name : Option < String > , ) -> Result < Self , ClientError > { debug ! ( " " sc_host_port spu_host_port kf_host_port profile_name ) ; // build profile config from cli parameters let cli_config = Self :: from_cli ( sc_host_port , spu_host_port , kf_host_port ) ? ; let profile_config = if cli_config . valid_servers_or_error ( ) . is_ok ( ) { debug ! ( " " ) ; cli_config } else { debug ! ( " " ) ; // build profile config from profile file let mut file_config = match profile_name { Some ( profile ) => ProfileConfig :: config_from_custom_profile ( profile ) ? , None => ProfileConfig :: config_from_default_profile ( ) ? , } ; // merge the profiles (cli takes precedence) file_config . merge_with ( & cli_config ) ; file_config } ; profile_config . valid_servers_or_error ( ) ? ; Ok ( profile_config ) }
generate profile configuration with spu based on a default or custom profile file
generate profile configuration with spu based on a default or custom profile file
sc_host_port
Option<String>
spu_host_port
Option<String>
kf_host_port
Option<String>
profile_name
Option<String>
sc_host_port
Option<String>
spu_host_port
Option<String>
kf_host_port
Option<String>
profile_name
Option<String>