pub struct TokenUtils;
Expand description
Token工具
Implementations§
Source§impl TokenUtils
impl TokenUtils
Sourcepub fn verify_token<T: DeserializeOwned>(token: &str, secret: &str) -> Result<T>
pub fn verify_token<T: DeserializeOwned>(token: &str, secret: &str) -> Result<T>
验证JWT Token
Sourcepub fn generate_uuid() -> String
pub fn generate_uuid() -> String
生成UUID
Sourcepub fn current_timestamp() -> i64
pub fn current_timestamp() -> i64
获取当前时间戳(秒)
Auto Trait Implementations§
impl Freeze for TokenUtils
impl RefUnwindSafe for TokenUtils
impl Send for TokenUtils
impl Sync for TokenUtils
impl Unpin for TokenUtils
impl UnwindSafe for TokenUtils
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