pub struct Valid;Expand description
通用验证工具
提供邮箱、手机号、URL、数字、字母数字、长度范围、 密码强度、IPv4、Base64 等常用格式的布尔校验方法。
Implementations§
Source§impl Valid
impl Valid
Sourcepub fn is_alphanumeric(s: &str) -> bool
pub fn is_alphanumeric(s: &str) -> bool
验证是否为字母+数字组合
Sourcepub fn is_strong_password(s: &str) -> bool
pub fn is_strong_password(s: &str) -> bool
验证密码强度(至少 8 位,包含大小写+数字)
Sourcepub fn is_chinese(s: &str) -> bool
pub fn is_chinese(s: &str) -> bool
验证是否全为中文字符
Auto Trait Implementations§
impl Forget for Valid
impl Freeze for Valid
impl Move for Valid
impl RefUnwindSafe for Valid
impl Send for Valid
impl Sync for Valid
impl Unpin for Valid
impl UnsafeUnpin for Valid
impl UnwindSafe for Valid
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