This commit is contained in:
2022-09-25 06:24:45 +00:00
committed by GitHub
parent cea025482f
commit 89e08ab968
8 changed files with 95 additions and 6 deletions

View File

@@ -1,7 +1,7 @@
use super::PixivDownloaderDbConfig;
use super::PixivDownloaderDbError;
#[cfg(feature = "server")]
use super::User;
use super::{Token, User};
#[async_trait]
pub trait PixivDownloaderDb {
@@ -24,6 +24,10 @@ pub trait PixivDownloaderDb {
password: &[u8],
) -> Result<User, PixivDownloaderDbError>;
#[cfg(feature = "server")]
/// Get token by ID
/// * `id` - The token ID
async fn get_token(&self, id: u64) -> Result<Option<Token>, PixivDownloaderDbError>;
#[cfg(feature = "server")]
/// Get a user by ID
/// * `id`: The user's ID
async fn get_user(&self, id: u64) -> Result<Option<User>, PixivDownloaderDbError>;