BitVFactory going on

This commit is contained in:
Igor Katson 2024-08-20 16:51:34 +01:00
parent d7236f05a9
commit e771162fa7
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
6 changed files with 148 additions and 10 deletions

View file

@ -13,7 +13,8 @@ use librqbit_core::Id20;
use serde::{Deserialize, Deserializer, Serialize, Serializer};
use crate::{
session::TorrentId, torrent_state::ManagedTorrentHandle, AddTorrent, AddTorrentOptions,
bitv_factory::BitVFactory, session::TorrentId, torrent_state::ManagedTorrentHandle, AddTorrent,
AddTorrentOptions,
};
#[derive(Serialize, Deserialize, Clone)]
@ -63,7 +64,7 @@ impl SerializedTorrent {
// TODO: make this info_hash first, ID-second.
#[async_trait]
pub trait SessionPersistenceStore: core::fmt::Debug + Send + Sync {
pub trait SessionPersistenceStore: core::fmt::Debug + Send + Sync + BitVFactory {
async fn next_id(&self) -> anyhow::Result<TorrentId>;
async fn store(&self, id: TorrentId, torrent: &ManagedTorrentHandle) -> anyhow::Result<()>;
async fn delete(&self, id: TorrentId) -> anyhow::Result<()>;