pub fn new_from_all(
        cli_cfg: SpuOpt,
        file_cfg: Option<SpuConfigFile>,
    ) -> Result<SpuConfig, IoError> {
        let spu_id = SpuConfig::make_spu_id(&cli_cfg, &file_cfg)?;
        let spu_type = SpuConfig::make_spu_type()?;
        let rack = SpuConfig::make_rack(&file_cfg)?;
        let public_endpoint = SpuConfig::make_public_endpoint(&cli_cfg, &file_cfg)?;
        let private_endpoint = SpuConfig::make_private_endpoint(&cli_cfg, &file_cfg)?;
        let sc_endpoint = SpuConfig::make_sc_endpoint(&cli_cfg, &file_cfg)?;
        let sc_retry_ms = SpuConfig::make_sc_retry_ms(&file_cfg)?;
        let min_in_sync_replicas = SpuConfig::make_min_in_sync_replicas(&file_cfg)?;
        let log_base_dir = SpuConfig::make_log_base_dir(&file_cfg)?;
        let log_size = SpuConfig::make_log_size(&file_cfg)?;
        let log_index_max_bytes = SpuConfig::make_log_index_max_bytes(&file_cfg)?;
        let log_index_max_interval_bytes = SpuConfig::make_log_index_max_interval_bytes(&file_cfg)?;
        let log_segment_max_bytes = SpuConfig::make_log_segment_max_bytes(&file_cfg)?;

        Ok(SpuConfig {
            id: spu_id,
            spu_type: spu_type,
            rack: rack,
            public_endpoint: public_endpoint,
            private_endpoint: private_endpoint,
            sc_endpoint: sc_endpoint,
            sc_retry_ms: sc_retry_ms,
            replication: Replication {
                min_in_sync_replicas: min_in_sync_replicas,
            },
            log: Log {
                base_dir: log_base_dir,
                size: log_size,
                index_max_bytes: log_index_max_bytes,
                index_max_interval_bytes: log_index_max_interval_bytes,
                segment_max_bytes: log_segment_max_bytes,
            }
        })
    }
/// Creates an SPU Config object by merging object in the following order of precedence:
///  * cli configuration
///  * environment variable
///  * config file
Creates an SPU Config object by merging object in the following order of precedence:
cli configuration
environment variable
config file
Creates an SPU Config object by merging object in the following order of precedence : cli configuration environment variable config file
pub fn new_from_all(
        cli_cfg: SpuOpt,
        file_cfg: Option<SpuConfigFile>,
    ) -> Result<SpuConfig, IoError> {
        let spu_id = SpuConfig::make_spu_id(&cli_cfg, &file_cfg)?;
        let spu_type = SpuConfig::make_spu_type()?;
        let rack = SpuConfig::make_rack(&file_cfg)?;
        let public_endpoint = SpuConfig::make_public_endpoint(&cli_cfg, &file_cfg)?;
        let private_endpoint = SpuConfig::make_private_endpoint(&cli_cfg, &file_cfg)?;
        let sc_endpoint = SpuConfig::make_sc_endpoint(&cli_cfg, &file_cfg)?;
        let sc_retry_ms = SpuConfig::make_sc_retry_ms(&file_cfg)?;
        let min_in_sync_replicas = SpuConfig::make_min_in_sync_replicas(&file_cfg)?;
        let log_base_dir = SpuConfig::make_log_base_dir(&file_cfg)?;
        let log_size = SpuConfig::make_log_size(&file_cfg)?;
        let log_index_max_bytes = SpuConfig::make_log_index_max_bytes(&file_cfg)?;
        let log_index_max_interval_bytes = SpuConfig::make_log_index_max_interval_bytes(&file_cfg)?;
        let log_segment_max_bytes = SpuConfig::make_log_segment_max_bytes(&file_cfg)?;
        Ok(SpuConfig {
            id: spu_id,
            spu_type: spu_type,
            rack: rack,
            public_endpoint: public_endpoint,
            private_endpoint: private_endpoint,
            sc_endpoint: sc_endpoint,
            sc_retry_ms: sc_retry_ms,
            replication: Replication {
                min_in_sync_replicas: min_in_sync_replicas,
            },
            log: Log {
                base_dir: log_base_dir,
                size: log_size,
                index_max_bytes: log_index_max_bytes,
                index_max_interval_bytes: log_index_max_interval_bytes,
                segment_max_bytes: log_segment_max_bytes,
            }
        })
    }
pub fn new_from_all ( cli_cfg : SpuOpt , file_cfg : Option < SpuConfigFile > , ) -> Result < SpuConfig , IoError > { let spu_id = SpuConfig :: make_spu_id ( & cli_cfg , & file_cfg ) ? ; let spu_type = SpuConfig :: make_spu_type ( ) ? ; let rack = SpuConfig :: make_rack ( & file_cfg ) ? ; let public_endpoint = SpuConfig :: make_public_endpoint ( & cli_cfg , & file_cfg ) ? ; let private_endpoint = SpuConfig :: make_private_endpoint ( & cli_cfg , & file_cfg ) ? ; let sc_endpoint = SpuConfig :: make_sc_endpoint ( & cli_cfg , & file_cfg ) ? ; let sc_retry_ms = SpuConfig :: make_sc_retry_ms ( & file_cfg ) ? ; let min_in_sync_replicas = SpuConfig :: make_min_in_sync_replicas ( & file_cfg ) ? ; let log_base_dir = SpuConfig :: make_log_base_dir ( & file_cfg ) ? ; let log_size = SpuConfig :: make_log_size ( & file_cfg ) ? ; let log_index_max_bytes = SpuConfig :: make_log_index_max_bytes ( & file_cfg ) ? ; let log_index_max_interval_bytes = SpuConfig :: make_log_index_max_interval_bytes ( & file_cfg ) ? ; let log_segment_max_bytes = SpuConfig :: make_log_segment_max_bytes ( & file_cfg ) ? ; Ok ( SpuConfig { id : spu_id , spu_type : spu_type , rack : rack , public_endpoint : public_endpoint , private_endpoint : private_endpoint , sc_endpoint : sc_endpoint , sc_retry_ms : sc_retry_ms , replication : Replication { min_in_sync_replicas : min_in_sync_replicas , } , log : Log { base_dir : log_base_dir , size : log_size , index_max_bytes : log_index_max_bytes , index_max_interval_bytes : log_index_max_interval_bytes , segment_max_bytes : log_segment_max_bytes , } } ) }
Creates an SPU Config object by merging object in the following order of precedence:
 cli configuration
 environment variable
 config file
Creates an SPU Config object by merging object in the following order of precedence : cli configuration environment variable config file
cli_cfg
SpuOpt
file_cfg
Option<SpuConfigFile>
cli_cfg
SpuOpt
file_cfg
Option<SpuConfigFile>