Split out TorrentMetadata
This commit is contained in:
parent
e440f03970
commit
100b7116df
20 changed files with 411 additions and 225 deletions
|
|
@ -20,7 +20,11 @@ struct CustomStorage {
|
|||
impl StorageFactory for CustomStorageFactory {
|
||||
type Storage = CustomStorage;
|
||||
|
||||
fn create(&self, _info: &librqbit::ManagedTorrentShared) -> anyhow::Result<Self::Storage> {
|
||||
fn create(
|
||||
&self,
|
||||
_: &librqbit::ManagedTorrentShared,
|
||||
_: &librqbit::TorrentMetadata,
|
||||
) -> anyhow::Result<Self::Storage> {
|
||||
Ok(CustomStorage::default())
|
||||
}
|
||||
|
||||
|
|
@ -54,7 +58,11 @@ impl TorrentStorage for CustomStorage {
|
|||
anyhow::bail!("not implemented")
|
||||
}
|
||||
|
||||
fn init(&mut self, _meta: &librqbit::ManagedTorrentShared) -> anyhow::Result<()> {
|
||||
fn init(
|
||||
&mut self,
|
||||
_meta: &librqbit::ManagedTorrentShared,
|
||||
_: &librqbit::TorrentMetadata,
|
||||
) -> anyhow::Result<()> {
|
||||
anyhow::bail!("not implemented")
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -49,7 +49,9 @@ async fn main() -> Result<(), anyhow::Error> {
|
|||
_ => unreachable!(),
|
||||
};
|
||||
|
||||
info!("Details: {:?}", &handle.shared().info);
|
||||
handle.with_metadata(|r| {
|
||||
info!("Details: {:?}", &r.info);
|
||||
})?;
|
||||
|
||||
// Print stats periodically.
|
||||
tokio::spawn({
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue