pub struct SmsConfig {
pub provider: String,
pub app_id: String,
pub app_key: String,
pub sign_name: String,
pub template_id: String,
pub tencent: Option<TencentSmsConfig>,
pub aliyun: Option<AliyunSmsConfig>,
}Expand description
短信配置
支持腾讯云和阿里云短信服务
§字段说明
provider: 短信提供商,可选值:tencent/aliyunapp_id: 应用 IDapp_key: 应用密钥sign_name: 短信签名template_id: 短信模板 IDtencent: 腾讯云短信配置(可选)aliyun: 阿里云短信配置(可选)
§示例
use admin_config::SmsConfig;
let config = SmsConfig {
provider: "tencent".to_string(),
app_id: "1400000000".to_string(),
..Default::default()
};Fields§
§provider: String短信提供商 (tencent/aliyun)
app_id: String应用 ID
app_key: String应用 Key
sign_name: String签名名称
template_id: String模板 ID
tencent: Option<TencentSmsConfig>腾讯云短信配置
aliyun: Option<AliyunSmsConfig>阿里云短信配置
Trait Implementations§
Source§impl<'de> Deserialize<'de> for SmsConfig
impl<'de> Deserialize<'de> for SmsConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for SmsConfig
impl RefUnwindSafe for SmsConfig
impl Send for SmsConfig
impl Sync for SmsConfig
impl Unpin for SmsConfig
impl UnwindSafe for SmsConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more