pub struct SecurityApi { /* private fields */ }Expand description
Security API
Provides methods for content security checks including text, media, and user risk assessment.
Implementations§
Source§impl SecurityApi
impl SecurityApi
Sourcepub fn new(context: Arc<WechatContext>) -> Self
pub fn new(context: Arc<WechatContext>) -> Self
Create a new SecurityApi instance
Sourcepub async fn msg_sec_check(
&self,
openid: &str,
scene: u8,
content: &str,
) -> Result<MsgSecCheckResponse, WechatError>
pub async fn msg_sec_check( &self, openid: &str, scene: u8, content: &str, ) -> Result<MsgSecCheckResponse, WechatError>
Check text content for policy violations
POST /wxa/msg_sec_check?access_token=ACCESS_TOKEN
§Arguments
openid- User’s OpenIDscene- Scene value (1=profile, 2=comment, 3=forum, 4=social log)content- Text content to check
Sourcepub async fn media_check_async(
&self,
media_url: &str,
media_type: u8,
openid: &str,
scene: u8,
) -> Result<MediaCheckAsyncResponse, WechatError>
pub async fn media_check_async( &self, media_url: &str, media_type: u8, openid: &str, scene: u8, ) -> Result<MediaCheckAsyncResponse, WechatError>
Async check media (image/audio) for policy violations
POST /wxa/media_check_async?access_token=ACCESS_TOKEN
§Arguments
media_url- URL of the media to checkmedia_type- Media type (1=audio, 2=image)openid- User’s OpenIDscene- Scene value
Sourcepub async fn get_user_risk_rank(
&self,
openid: &str,
scene: u8,
options: Option<UserRiskRankOptions>,
) -> Result<UserRiskRankResponse, WechatError>
pub async fn get_user_risk_rank( &self, openid: &str, scene: u8, options: Option<UserRiskRankOptions>, ) -> Result<UserRiskRankResponse, WechatError>
Get user risk rank score
POST /wxa/getuserriskrank?access_token=ACCESS_TOKEN
§Arguments
openid- User’s OpenIDscene- Scene value (0=registration, 1=marketing)options- Additional optional parameters
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SecurityApi
impl !RefUnwindSafe for SecurityApi
impl Send for SecurityApi
impl Sync for SecurityApi
impl Unpin for SecurityApi
impl UnsafeUnpin for SecurityApi
impl !UnwindSafe for SecurityApi
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