Move around storage into folders
This commit is contained in:
parent
6233cc9d12
commit
2c500049e8
10 changed files with 18 additions and 14 deletions
|
|
@ -1,7 +1,7 @@
|
|||
use std::time::Duration;
|
||||
|
||||
use librqbit::{
|
||||
storage::{mmap::MmapStorageFactory, StorageFactoryExt},
|
||||
storage::{examples::mmap::MmapStorageFactory, StorageFactoryExt},
|
||||
SessionOptions,
|
||||
};
|
||||
use tracing::info;
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use parking_lot::RwLock;
|
|||
|
||||
use crate::type_aliases::FileInfos;
|
||||
|
||||
use super::{StorageFactory, TorrentStorage};
|
||||
use crate::storage::{StorageFactory, TorrentStorage};
|
||||
|
||||
struct InMemoryPiece {
|
||||
bytes: Box<[u8]>,
|
||||
|
|
@ -2,9 +2,10 @@ use anyhow::Context;
|
|||
use memmap2::{MmapMut, MmapOptions};
|
||||
use parking_lot::RwLock;
|
||||
|
||||
use crate::{FileInfos, ManagedTorrentInfo};
|
||||
|
||||
use super::{StorageFactory, TorrentStorage};
|
||||
use crate::{
|
||||
storage::{StorageFactory, TorrentStorage},
|
||||
FileInfos, ManagedTorrentInfo,
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
pub struct MmapStorageFactory {}
|
||||
2
crates/librqbit/src/storage/examples/mod.rs
Normal file
2
crates/librqbit/src/storage/examples/mod.rs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pub mod inmemory;
|
||||
pub mod mmap;
|
||||
2
crates/librqbit/src/storage/middleware/mod.rs
Normal file
2
crates/librqbit/src/storage/middleware/mod.rs
Normal file
|
|
@ -0,0 +1,2 @@
|
|||
pub mod slow;
|
||||
pub mod timing;
|
||||
|
|
@ -2,7 +2,7 @@ use std::time::Duration;
|
|||
|
||||
use rand_distr::Distribution;
|
||||
|
||||
use super::{StorageFactory, TorrentStorage};
|
||||
use crate::storage::{StorageFactory, TorrentStorage};
|
||||
|
||||
pub struct SlowStorageFactory<U> {
|
||||
underlying_factory: U,
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
use super::{StorageFactory, TorrentStorage};
|
||||
use crate::storage::{StorageFactory, TorrentStorage};
|
||||
|
||||
pub struct TimingStorageFactory<U> {
|
||||
name: String,
|
||||
|
|
@ -1,8 +1,6 @@
|
|||
pub mod example;
|
||||
pub mod examples;
|
||||
pub mod filesystem;
|
||||
pub mod mmap;
|
||||
pub mod slow;
|
||||
pub mod timing;
|
||||
pub mod middleware;
|
||||
|
||||
use std::{
|
||||
any::{Any, TypeId},
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ use tracing::info;
|
|||
|
||||
use crate::{
|
||||
create_torrent,
|
||||
storage::{example::InMemoryExampleStorageFactory, StorageFactoryExt},
|
||||
storage::{examples::inmemory::InMemoryExampleStorageFactory, StorageFactoryExt},
|
||||
AddTorrent, CreateTorrentOptions, Session,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -8,8 +8,9 @@ use librqbit::{
|
|||
http_api::{HttpApi, HttpApiOptions},
|
||||
http_api_client, librqbit_spawn,
|
||||
storage::{
|
||||
filesystem::FilesystemStorageFactory, slow::SlowStorageFactory,
|
||||
timing::TimingStorageFactory, StorageFactoryExt,
|
||||
filesystem::FilesystemStorageFactory,
|
||||
middleware::{slow::SlowStorageFactory, timing::TimingStorageFactory},
|
||||
StorageFactoryExt,
|
||||
},
|
||||
tracing_subscriber_config_utils::{init_logging, InitLoggingOptions},
|
||||
AddTorrent, AddTorrentOptions, AddTorrentResponse, Api, ListOnlyResponse,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue