/// Creates a Custom Commands config instance with the specified application id,
/// subscription key and region.
Creates a Custom Commands config instance with the specified application id,
subscription key and region.
Creates a Custom Commands config instance with the specified application id subscription key and region .
pub fn from_subscription<S>(
        application_id: S,
        subscription_key: S,
        region: S,
    ) -> Result<CustomCommandsConfig>
    where
        S: Into<Vec<u8>>,
    {
        unsafe {
            let mut handle: SPXSPEECHCONFIGHANDLE = MaybeUninit::uninit().assume_init();
            let c_sub_key = CString::new(subscription_key)?;
            let c_region = CString::new(region)?;
            let c_application_id = CString::new(application_id)?;
            let ret = custom_commands_config_from_subscription(
                &mut handle,
                c_application_id.as_ptr(),
                c_sub_key.as_ptr(),
                c_region.as_ptr(),
            );
            convert_err(ret, "CustomCommandsConfig::from_subscription error")?;
            Ok(CustomCommandsConfig {
                config: SpeechConfig::from_handle(handle)?,
            })
        }
    }
pub fn from_subscription < S > ( application_id : S , subscription_key : S , region : S , ) -> Result < CustomCommandsConfig > where S : Into < Vec < u8 > > , { unsafe { let mut handle : SPXSPEECHCONFIGHANDLE = MaybeUninit :: uninit ( ) . assume_init ( ) ; let c_sub_key = CString :: new ( subscription_key ) ? ; let c_region = CString :: new ( region ) ? ; let c_application_id = CString :: new ( application_id ) ? ; let ret = custom_commands_config_from_subscription ( & mut handle , c_application_id . as_ptr ( ) , c_sub_key . as_ptr ( ) , c_region . as_ptr ( ) , ) ; convert_err ( ret , " " ) ? ; Ok ( CustomCommandsConfig { config : SpeechConfig :: from_handle ( handle ) ? , } ) } }
Creates a Custom Commands config instance with the specified application id,
subscription key and region.
Creates a Custom Commands config instance with the specified application id subscription key and region .
application_id
S
subscription_key
S
region
S