pub enum Scene {
Profile = 1,
Comment = 2,
Forum = 3,
SocialLog = 4,
}Expand description
内容安全检测场景
定义不同的内容检测场景,不同场景有不同的检测策略和敏感度。
§场景说明
- 资料: 用户昵称、头像、个性签名等个人信息
- 评论: 用户评论、留言等互动内容
- 论坛: 论坛帖子、文章等长文本内容
- 社交日志: 朋友圈、动态等社交内容
§示例
use wechat_minapp::minapp_security::Scene;
let profile_scene = Scene::Profile;
let comment_scene = Scene::Comment;
let forum_scene = Scene::Forum;
let social_scene = Scene::SocialLog;
assert_eq!(profile_scene as u32, 1);
assert_eq!(profile_scene.description(), "资料");Variants§
Implementations§
Source§impl Scene
impl Scene
Sourcepub fn from_value(value: u32) -> Option<Self>
pub fn from_value(value: u32) -> Option<Self>
从数值创建场景
Sourcepub fn description(&self) -> &'static str
pub fn description(&self) -> &'static str
获取场景描述
Trait Implementations§
impl Copy for Scene
impl StructuralPartialEq for Scene
Auto Trait Implementations§
impl Freeze for Scene
impl RefUnwindSafe for Scene
impl Send for Scene
impl Sync for Scene
impl Unpin for Scene
impl UnwindSafe for Scene
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