Skip to content

Commit 89123fa

Browse files
committed
feat!: [torrust#1491] remove unused traits RepositoryAsync and EntryAsync
They have been moved to a new package `torrent-repository-benchmarking`.
1 parent b2a9684 commit 89123fa

File tree

2 files changed

+0
-34
lines changed

2 files changed

+0
-34
lines changed

packages/torrent-repository/src/entry/mod.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -59,22 +59,6 @@ pub trait EntrySync {
5959
fn remove_inactive_peers(&self, current_cutoff: DurationSinceUnixEpoch);
6060
}
6161

62-
#[allow(clippy::module_name_repetitions)]
63-
pub trait EntryAsync {
64-
fn get_swarm_metadata(&self) -> impl std::future::Future<Output = SwarmMetadata> + Send;
65-
fn meets_retaining_policy(self, policy: &TrackerPolicy) -> impl std::future::Future<Output = bool> + Send;
66-
fn peers_is_empty(&self) -> impl std::future::Future<Output = bool> + Send;
67-
fn get_peers_len(&self) -> impl std::future::Future<Output = usize> + Send;
68-
fn get_peers(&self, limit: Option<usize>) -> impl std::future::Future<Output = Vec<Arc<peer::Peer>>> + Send;
69-
fn get_peers_for_client(
70-
&self,
71-
client: &SocketAddr,
72-
limit: Option<usize>,
73-
) -> impl std::future::Future<Output = Vec<Arc<peer::Peer>>> + Send;
74-
fn upsert_peer(self, peer: &peer::Peer) -> impl std::future::Future<Output = bool> + Send;
75-
fn remove_inactive_peers(self, current_cutoff: DurationSinceUnixEpoch) -> impl std::future::Future<Output = ()> + Send;
76-
}
77-
7862
/// A data structure containing all the information about a torrent in the tracker.
7963
///
8064
/// This is the tracker entry for a given torrent and contains the swarm data,

packages/torrent-repository/src/repository/mod.rs

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,21 +19,3 @@ pub trait Repository<T>: Debug + Default + Sized + 'static {
1919
fn upsert_peer(&self, info_hash: &InfoHash, peer: &peer::Peer, opt_persistent_torrent: Option<PersistentTorrent>) -> bool;
2020
fn get_swarm_metadata(&self, info_hash: &InfoHash) -> Option<SwarmMetadata>;
2121
}
22-
23-
#[allow(clippy::module_name_repetitions)]
24-
pub trait RepositoryAsync<T>: Debug + Default + Sized + 'static {
25-
fn get(&self, key: &InfoHash) -> impl std::future::Future<Output = Option<T>> + Send;
26-
fn get_metrics(&self) -> impl std::future::Future<Output = AggregateSwarmMetadata> + Send;
27-
fn get_paginated(&self, pagination: Option<&Pagination>) -> impl std::future::Future<Output = Vec<(InfoHash, T)>> + Send;
28-
fn import_persistent(&self, persistent_torrents: &PersistentTorrents) -> impl std::future::Future<Output = ()> + Send;
29-
fn remove(&self, key: &InfoHash) -> impl std::future::Future<Output = Option<T>> + Send;
30-
fn remove_inactive_peers(&self, current_cutoff: DurationSinceUnixEpoch) -> impl std::future::Future<Output = ()> + Send;
31-
fn remove_peerless_torrents(&self, policy: &TrackerPolicy) -> impl std::future::Future<Output = ()> + Send;
32-
fn upsert_peer(
33-
&self,
34-
info_hash: &InfoHash,
35-
peer: &peer::Peer,
36-
opt_persistent_torrent: Option<PersistentTorrent>,
37-
) -> impl std::future::Future<Output = bool> + Send;
38-
fn get_swarm_metadata(&self, info_hash: &InfoHash) -> impl std::future::Future<Output = Option<SwarmMetadata>> + Send;
39-
}

0 commit comments

Comments
 (0)