Trait lightspeed_auth::repository::TokenRepository
source · pub trait TokenRepository<Id: IdType>: Clone + Send + Sync {
type Tx: Send + Sync;
// Required methods
fn fetch_by_token(
&self,
tx: &mut Self::Tx,
token_string: &str
) -> impl Future<Output = Result<TokenModel<Id>, LsError>> + Send;
fn fetch_by_username(
&self,
tx: &mut Self::Tx,
username: &str
) -> impl Future<Output = Result<Vec<TokenModel<Id>>, LsError>> + Send;
fn save(
&self,
tx: &mut Self::Tx,
model: NewModel<TokenData>
) -> impl Future<Output = Result<TokenModel<Id>, LsError>> + Send;
fn delete(
&self,
tx: &mut Self::Tx,
model: TokenModel<Id>
) -> impl Future<Output = Result<TokenModel<Id>, LsError>> + Send;
}
Required Associated Types§
Required Methods§
fn fetch_by_token( &self, tx: &mut Self::Tx, token_string: &str ) -> impl Future<Output = Result<TokenModel<Id>, LsError>> + Send
fn fetch_by_username( &self, tx: &mut Self::Tx, username: &str ) -> impl Future<Output = Result<Vec<TokenModel<Id>>, LsError>> + Send
fn save( &self, tx: &mut Self::Tx, model: NewModel<TokenData> ) -> impl Future<Output = Result<TokenModel<Id>, LsError>> + Send
fn delete( &self, tx: &mut Self::Tx, model: TokenModel<Id> ) -> impl Future<Output = Result<TokenModel<Id>, LsError>> + Send
Object Safety§
This trait is not object safe.