pub struct NotifyConfig {
pub token: String,
pub encoding_aes_key: String,
pub app_id: String,
pub data_format: DataFormat,
/* private fields */
}Expand description
消息推送配置(后台「消息推送」三项)
Fields§
§token: StringToken
encoding_aes_key: StringEncodingAESKey(43 字符,不含末尾 =)
app_id: String小程序 AppID(解密后校验)
data_format: DataFormat数据格式
Implementations§
Source§impl NotifyConfig
impl NotifyConfig
Sourcepub fn new(
token: impl Into<String>,
encoding_aes_key: impl Into<String>,
app_id: impl Into<String>,
) -> Result<NotifyConfig, NotifyError>
pub fn new( token: impl Into<String>, encoding_aes_key: impl Into<String>, app_id: impl Into<String>, ) -> Result<NotifyConfig, NotifyError>
创建配置
Sourcepub fn with_data_format(self, format: DataFormat) -> NotifyConfig
pub fn with_data_format(self, format: DataFormat) -> NotifyConfig
设置数据格式
Sourcepub fn from_env() -> Result<NotifyConfig, NotifyError>
pub fn from_env() -> Result<NotifyConfig, NotifyError>
从环境变量加载
WECHAT_MP_APP_IDWECHAT_MP_PUSH_TOKENWECHAT_MP_PUSH_AES_KEYWECHAT_MP_PUSH_FORMAT(可选:json/xml)
Trait Implementations§
Source§impl Clone for NotifyConfig
impl Clone for NotifyConfig
Source§fn clone(&self) -> NotifyConfig
fn clone(&self) -> NotifyConfig
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for NotifyConfig
impl RefUnwindSafe for NotifyConfig
impl Send for NotifyConfig
impl Sync for NotifyConfig
impl Unpin for NotifyConfig
impl UnsafeUnpin for NotifyConfig
impl UnwindSafe for NotifyConfig
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