pub fn build_service(config: &ServiceConfig) -> Result<FrontEndHandler> {
        let key_id_managers =
            build_key_id_managers(config.key_manager.as_ref().unwrap_or(&Vec::new()))?;

        let providers = build_providers(
            config.provider.as_ref().unwrap_or(&Vec::new()),
            key_id_managers,
        );

        if providers.is_empty() {
            error!("Parsec needs at least one provider to start. No valid provider could be created from the configuration.");
            return Err(Error::new(ErrorKind::InvalidData, "need one provider"));
        }

        let backend_handlers = build_backend_handlers(providers)?;

        let dispatcher = DispatcherBuilder::new()
            .with_backends(backend_handlers)
            .build()?;

        let direct_authenticator = Box::from(DirectAuthenticator {});

        Ok(FrontEndHandlerBuilder::new()
            .with_dispatcher(dispatcher)
            .with_authenticator(AuthType::Direct, direct_authenticator)
            .with_body_len_limit(
                config
                    .core_settings
                    .body_len_limit
                    .unwrap_or(DEFAULT_BODY_LEN_LIMIT),
            )
            .build()?)
    }
/// Evaluate the provided configuration and assemble a service based on it. If the configuration contains
/// any errors or inconsistencies, an `Err` is returned.
///
/// # Errors
/// * if any of the fields specified in the configuration are inconsistent (e.g. key ID manager with name 'X'
/// requested for a certain provider does not exist) or if required fields are missing, an error of kind
/// `InvalidData` is returned with a string describing the cause more accurately.
Evaluate the provided configuration and assemble a service based on it. If the configuration contains
any errors or inconsistencies, an `Err` is returned.
Evaluate the provided configuration and assemble a service based on it . If the configuration contains any errors or inconsistencies an ` Err ` is returned .
pub fn build_service(config: &ServiceConfig) -> Result<FrontEndHandler> {
        let key_id_managers =
            build_key_id_managers(config.key_manager.as_ref().unwrap_or(&Vec::new()))?;
        let providers = build_providers(
            config.provider.as_ref().unwrap_or(&Vec::new()),
            key_id_managers,
        );
        if providers.is_empty() {
            error!("Parsec needs at least one provider to start. No valid provider could be created from the configuration.");
            return Err(Error::new(ErrorKind::InvalidData, "need one provider"));
        }
        let backend_handlers = build_backend_handlers(providers)?;
        let dispatcher = DispatcherBuilder::new()
            .with_backends(backend_handlers)
            .build()?;
        let direct_authenticator = Box::from(DirectAuthenticator {});
        Ok(FrontEndHandlerBuilder::new()
            .with_dispatcher(dispatcher)
            .with_authenticator(AuthType::Direct, direct_authenticator)
            .with_body_len_limit(
                config
                    .core_settings
                    .body_len_limit
                    .unwrap_or(DEFAULT_BODY_LEN_LIMIT),
            )
            .build()?)
    }
pub fn build_service ( config : & ServiceConfig ) -> Result < FrontEndHandler > { let key_id_managers = build_key_id_managers ( config . key_manager . as_ref ( ) . unwrap_or ( & Vec :: new ( ) ) ) ? ; let providers = build_providers ( config . provider . as_ref ( ) . unwrap_or ( & Vec :: new ( ) ) , key_id_managers , ) ; if providers . is_empty ( ) { error ! ( " " ) ; return Err ( Error :: new ( ErrorKind :: InvalidData , " " ) ) ; } let backend_handlers = build_backend_handlers ( providers ) ? ; let dispatcher = DispatcherBuilder :: new ( ) . with_backends ( backend_handlers ) . build ( ) ? ; let direct_authenticator = Box :: from ( DirectAuthenticator { } ) ; Ok ( FrontEndHandlerBuilder :: new ( ) . with_dispatcher ( dispatcher ) . with_authenticator ( AuthType :: Direct , direct_authenticator ) . with_body_len_limit ( config . core_settings . body_len_limit . unwrap_or ( DEFAULT_BODY_LEN_LIMIT ) , ) . build ( ) ? ) }
Evaluate the provided configuration and assemble a service based on it.
Evaluate the provided configuration and assemble a service based on it .
config
&ServiceConfig
config
&ServiceConfig
errors
if any of the fields specified in the configuration are inconsistent  or if required fields are missing, an error of kind
`InvalidData` is returned with a string describing the cause more accurately.
if any of the fields specified in the configuration are inconsistent or if required fields are missing an error of kind ` InvalidData ` is returned with a string describing the cause more accurately .