pub struct Database { /* private fields */ }Implementations§
Trait Implementations§
Source§impl DbProvider for Database
impl DbProvider for Database
fn get_total_unique_cached_crates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_cached_crate_versions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_cached_downloads<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn authenticate_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
pwd: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn increase_download_counter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
crate_version: &'life2 Version,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn increase_cached_download_counter<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
crate_version: &'life2 Version,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn increase_download_counter_by<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
crate_version: &'life2 Version,
count: u64,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn increase_cached_download_counter_by<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
crate_version: &'life2 Version,
count: u64,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_last_updated_crate<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Option<(OriginalName, Version)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn validate_session<'life0, 'life1, 'async_trait>(
&'life0 self,
session_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<(String, bool)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_session_token<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
session_token: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_crate_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_crate_group<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
group: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_group_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_name: &'life1 str,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_owner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_download_restricted<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn change_download_restricted<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
restricted: bool,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_crate_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_crate_group<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
group: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_crate_group_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_group_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_name: &'life1 str,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn is_owner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_crate_id<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Option<i64>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_crate_owners<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_crate_users<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_crate_groups<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<Group>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_group_users<'life0, 'life1, 'async_trait>(
&'life0 self,
group_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_crate_versions<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<Version>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_session_token<'life0, 'life1, 'async_trait>(
&'life0 self,
session_token: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_user<'life0, 'life1, 'async_trait>(
&'life0 self,
user_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_group<'life0, 'life1, 'async_trait>(
&'life0 self,
group_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn change_pwd<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_name: &'life1 str,
new_pwd: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn change_read_only_state<'life0, 'life1, 'async_trait>(
&'life0 self,
user_name: &'life1 str,
state: bool,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn change_admin_state<'life0, 'life1, 'async_trait>(
&'life0 self,
user_name: &'life1 str,
state: bool,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn crate_version_exists<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_id: i64,
version: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_max_version_from_id<'life0, 'async_trait>(
&'life0 self,
crate_id: i64,
) -> Pin<Box<dyn Future<Output = DbResult<Version>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_max_version_from_name<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Version>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_max_version<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_id: i64,
version: &'life1 Version,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_auth_token<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
token: &'life2 str,
user: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn get_user_from_token<'life0, 'life1, 'async_trait>(
&'life0 self,
token: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_user<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_group<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Group>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_auth_tokens<'life0, 'life1, 'async_trait>(
&'life0 self,
user_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<AuthToken>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_auth_token<'life0, 'async_trait>(
&'life0 self,
id: i32,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_owner<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 str,
owner: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_crate_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_crate_group<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
group: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_group_user<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
group_name: &'life1 str,
user: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
pwd: &'life2 str,
salt: &'life3 str,
is_admin: bool,
is_read_only: bool,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_group<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_users<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_groups<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<Group>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_unique_crates<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_crate_versions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_total_downloads<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_top_crates_downloads<'life0, 'async_trait>(
&'life0 self,
top: u64,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<(String, u64)>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_crate_summaries<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<CrateSummary>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_doc_queue<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
krate: &'life1 NormalizedName,
version: &'life2 Version,
path: &'life3 Path,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn delete_doc_queue<'life0, 'async_trait>(
&'life0 self,
id: i64,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_doc_queue<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<DocQueueEntry>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_crate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
krate: &'life1 NormalizedName,
version: &'life2 Version,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_crate_meta_list<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<CrateMeta>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn update_last_updated<'life0, 'life1, 'async_trait>(
&'life0 self,
id: i64,
last_updated: &'life1 DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn search_in_crate_name<'life0, 'life1, 'async_trait>(
&'life0 self,
contains: &'life1 str,
cache: bool,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<CrateOverview>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_crate_overview_list<'life0, 'async_trait>(
&'life0 self,
limit: u64,
offset: u64,
cache: bool,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<CrateOverview>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_crate_data<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
) -> Pin<Box<dyn Future<Output = DbResult<CrateData>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_empty_crate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
created: &'life2 DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = DbResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn add_crate<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
pub_metadata: &'life1 PublishMetadata,
cksum: &'life2 str,
created: &'life3 DateTime<Utc>,
owner: &'life4 str,
) -> Pin<Box<dyn Future<Output = DbResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn update_docs_link<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
version: &'life2 Version,
docs_link: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_crate_metadata<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
pub_metadata: &'life1 PublishMetadata,
created: &'life2 str,
crate_id: i64,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_prefetch_data<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Prefetch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_cratesio_cache_up_to_date<'life0, 'life1, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
etag: Option<String>,
last_modified: Option<String>,
) -> Pin<Box<dyn Future<Output = DbResult<PrefetchState>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn add_cratesio_prefetch_data<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
crate_name: &'life1 OriginalName,
etag: &'life2 str,
last_modified: &'life3 str,
description: Option<String>,
indices: &'life4 [IndexMetadata],
) -> Pin<Box<dyn Future<Output = DbResult<Prefetch>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn get_cratesio_index_update_list<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<CratesioPrefetchMsg>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn unyank_crate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
version: &'life2 Version,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn yank_crate<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
crate_name: &'life1 NormalizedName,
version: &'life2 Version,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn register_webhook<'life0, 'async_trait>(
&'life0 self,
webhook: Webhook,
) -> Pin<Box<dyn Future<Output = DbResult<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn delete_webhook<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_webhook<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Webhook>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_all_webhooks<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<Webhook>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn add_webhook_queue<'life0, 'async_trait>(
&'life0 self,
event: WebhookEvent,
payload: Value,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_webhook_queue<'life0, 'async_trait>(
&'life0 self,
event: WebhookEvent,
payload: Value,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates a new webhook queue entry for each register webhook
matching the given event.
Next_attempt is set to current time,
in order to trigger immediate dispatch.Source§fn get_pending_webhook_queue_entries<'life0, 'async_trait>(
&'life0 self,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<WebhookQueue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_pending_webhook_queue_entries<'life0, 'async_trait>(
&'life0 self,
timestamp: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<WebhookQueue>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Extracts webhook queue entries with
next_attempt at or earlier than provided timestamp.fn update_webhook_queue<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
last_attempt: DateTime<Utc>,
next_attempt: DateTime<Utc>,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_webhook_queue<'life0, 'life1, 'async_trait>(
&'life0 self,
id: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_user_by_oauth2_identity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
issuer: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_user_by_oauth2_identity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
issuer: &'life1 str,
subject: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<User>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Look up a user by their
OAuth2 identity (issuer + subject)Source§fn create_oauth2_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
username: &'life1 str,
issuer: &'life2 str,
subject: &'life3 str,
email: Option<String>,
is_admin: bool,
is_read_only: bool,
) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn create_oauth2_user<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
username: &'life1 str,
issuer: &'life2 str,
subject: &'life3 str,
email: Option<String>,
is_admin: bool,
is_read_only: bool,
) -> Pin<Box<dyn Future<Output = DbResult<User>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Create a new user from
OAuth2 authentication and link their identitySource§fn link_oauth2_identity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: i64,
issuer: &'life1 str,
subject: &'life2 str,
email: Option<String>,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn link_oauth2_identity<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
user_id: i64,
issuer: &'life1 str,
subject: &'life2 str,
email: Option<String>,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Link an
OAuth2 identity to an existing userSource§fn store_oauth2_state<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 str,
pkce_verifier: &'life2 str,
nonce: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn store_oauth2_state<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
state: &'life1 str,
pkce_verifier: &'life2 str,
nonce: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Store
OAuth2 state for CSRF/PKCE verification during auth flowSource§fn get_and_delete_oauth2_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<OAuth2StateData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_and_delete_oauth2_state<'life0, 'life1, 'async_trait>(
&'life0 self,
state: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<OAuth2StateData>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Retrieve and delete
OAuth2 state (single use)Source§fn cleanup_expired_oauth2_states<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn cleanup_expired_oauth2_states<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<u64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Clean up expired
OAuth2 states (older than 10 minutes)Source§fn is_username_available<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_username_available<'life0, 'life1, 'async_trait>(
&'life0 self,
username: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Check if username is available (for
OAuth2 auto-provisioning)Source§fn add_toolchain<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
date: &'life3 str,
channel: Option<String>,
) -> Pin<Box<dyn Future<Output = DbResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_toolchain<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
date: &'life3 str,
channel: Option<String>,
) -> Pin<Box<dyn Future<Output = DbResult<i64>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add a new toolchain release
Source§fn add_toolchain_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
toolchain_id: i64,
target: &'life1 str,
storage_path: &'life2 str,
hash: &'life3 str,
size: i64,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn add_toolchain_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
toolchain_id: i64,
target: &'life1 str,
storage_path: &'life2 str,
hash: &'life3 str,
size: i64,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Add a target archive to an existing toolchain
Source§fn get_toolchain_by_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<ToolchainWithTargets>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_toolchain_by_channel<'life0, 'life1, 'async_trait>(
&'life0 self,
channel: &'life1 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<ToolchainWithTargets>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Get a toolchain by its channel (e.g., “stable”, “nightly”)
Source§fn get_toolchain_by_version<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<ToolchainWithTargets>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn get_toolchain_by_version<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<Option<ToolchainWithTargets>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Get a toolchain by name and version
Source§fn list_toolchains<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<ToolchainWithTargets>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_toolchains<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<ToolchainWithTargets>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
List all toolchains
Source§fn delete_toolchain<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn delete_toolchain<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Delete a toolchain and all its targets
Source§fn delete_toolchain_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
target: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn delete_toolchain_target<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
name: &'life1 str,
version: &'life2 str,
target: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Delete a specific toolchain target
Source§fn set_channel<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
channel: &'life1 str,
name: &'life2 str,
version: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn set_channel<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
channel: &'life1 str,
name: &'life2 str,
version: &'life3 str,
) -> Pin<Box<dyn Future<Output = DbResult<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Set a channel to point to a specific toolchain version
Source§fn get_channels<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<ChannelInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn get_channels<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = DbResult<Vec<ChannelInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Get all channels with their current versions
Auto Trait Implementations§
impl Freeze for Database
impl !RefUnwindSafe for Database
impl Send for Database
impl Sync for Database
impl Unpin for Database
impl UnsafeUnpin for Database
impl !UnwindSafe for Database
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more