pub struct JwtManager { /* private fields */ }Expand description
JWT管理器
Implementations§
Source§impl JwtManager
impl JwtManager
Sourcepub fn verify_token<T>(&self, token: &str) -> Result<T>where
T: DeserializeOwned,
pub fn verify_token<T>(&self, token: &str) -> Result<T>where
T: DeserializeOwned,
验证并解析JWT token
Sourcepub fn is_valid_token(&self, token: &str) -> bool
pub fn is_valid_token(&self, token: &str) -> bool
检查token是否有效(不解析payload)
Auto Trait Implementations§
impl Freeze for JwtManager
impl RefUnwindSafe for JwtManager
impl Send for JwtManager
impl Sync for JwtManager
impl Unpin for JwtManager
impl UnwindSafe for JwtManager
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