Struct lightspeed_auth::service::token::LsTokenService
source · pub struct LsTokenService<Id: IdType, RepoManager: AuthRepositoryManager<Id>> { /* private fields */ }
Implementations§
source§impl<Id: IdType, RepoManager: AuthRepositoryManager<Id>> LsTokenService<Id, RepoManager>
impl<Id: IdType, RepoManager: AuthRepositoryManager<Id>> LsTokenService<Id, RepoManager>
pub fn new(auth_config: AuthConfig, token_repo: RepoManager::TokenRepo) -> Self
pub async fn generate_and_save_token_with_conn<S: Into<String>>( &self, conn: &mut RepoManager::Tx, username: S, token_type: TokenType ) -> Result<TokenModel<Id>, LsError>
pub async fn fetch_by_token_with_conn( &self, conn: &mut RepoManager::Tx, token: &str, validate: bool ) -> Result<TokenModel<Id>, LsError>
pub async fn fetch_all_by_username_with_conn( &self, conn: &mut RepoManager::Tx, username: &str ) -> Result<Vec<TokenModel<Id>>, LsError>
pub async fn delete_with_conn( &self, conn: &mut RepoManager::Tx, token_model: TokenModel<Id> ) -> Result<TokenModel<Id>, LsError>
Trait Implementations§
source§impl<Id: Clone + IdType, RepoManager: Clone + AuthRepositoryManager<Id>> Clone for LsTokenService<Id, RepoManager>
impl<Id: Clone + IdType, RepoManager: Clone + AuthRepositoryManager<Id>> Clone for LsTokenService<Id, RepoManager>
source§fn clone(&self) -> LsTokenService<Id, RepoManager>
fn clone(&self) -> LsTokenService<Id, RepoManager>
Returns a copy 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 moreAuto Trait Implementations§
impl<Id, RepoManager> Freeze for LsTokenService<Id, RepoManager>
impl<Id, RepoManager> RefUnwindSafe for LsTokenService<Id, RepoManager>
impl<Id, RepoManager> Send for LsTokenService<Id, RepoManager>
impl<Id, RepoManager> Sync for LsTokenService<Id, RepoManager>
impl<Id, RepoManager> Unpin for LsTokenService<Id, RepoManager>
impl<Id, RepoManager> UnwindSafe for LsTokenService<Id, RepoManager>
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