pub struct VerificationCodeConfig {
pub length: usize,
pub ttl: u64,
pub send_interval: u64,
}Expand description
验证码配置
用于配置验证码的长度、有效期和发送限制
§字段说明
length: 验证码长度(字符数),默认 6ttl: 验证码有效期(秒),默认 300 秒(5 分钟)send_interval: 两次发送的最小间隔(秒),默认 60 秒
§示例
use admin_config::VerificationCodeConfig;
let config = VerificationCodeConfig::default();
assert_eq!(config.length, 6);
assert_eq!(config.ttl, 300);
assert_eq!(config.send_interval, 60);Fields§
§length: usize验证码长度
ttl: u64过期时间(秒)
send_interval: u64发送间隔(秒)
Trait Implementations§
Source§impl Clone for VerificationCodeConfig
impl Clone for VerificationCodeConfig
Source§fn clone(&self) -> VerificationCodeConfig
fn clone(&self) -> VerificationCodeConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VerificationCodeConfig
impl Debug for VerificationCodeConfig
Source§impl Default for VerificationCodeConfig
impl Default for VerificationCodeConfig
Source§impl<'de> Deserialize<'de> for VerificationCodeConfig
impl<'de> Deserialize<'de> for VerificationCodeConfig
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 VerificationCodeConfig
impl RefUnwindSafe for VerificationCodeConfig
impl Send for VerificationCodeConfig
impl Sync for VerificationCodeConfig
impl Unpin for VerificationCodeConfig
impl UnwindSafe for VerificationCodeConfig
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