Skip to content
Open
2 changes: 1 addition & 1 deletion Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "iroh-blobs"
version = "0.34.1"
version = "0.35.1"
edition = "2021"
readme = "README.md"
description = "blob and collection transfer support for iroh"
Expand Down
1 change: 1 addition & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
#![deny(missing_docs, rustdoc::broken_intra_doc_links)]
#![recursion_limit = "256"]
#![cfg_attr(iroh_docsrs, feature(doc_auto_cfg))]
#![feature(async_closure)]

#[cfg(feature = "cli")]
pub mod cli;
Expand Down
16 changes: 12 additions & 4 deletions src/net_protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use std::{
collections::BTreeSet,
fmt::Debug,
ops::{Deref, DerefMut},
path::PathBuf,
sync::Arc,
};

Expand All @@ -20,7 +21,7 @@ use tracing::debug;
use crate::{
downloader::{ConcurrencyLimits, Downloader, RetryConfig},
provider::EventSender,
store::GcConfig,
store::{fs::Persistence, GcConfig},
util::{
local_pool::{self, LocalPool, LocalPoolHandle},
SetTagOption,
Expand Down Expand Up @@ -221,12 +222,19 @@ impl Blobs<crate::store::mem::Store> {
}
}

impl Blobs<crate::store::fs::Store> {
impl<T> Blobs<crate::store::fs::Store<T>>
where
T: Persistence,
{
/// Load a persistent Blobs protocol handler from a path.
pub async fn persistent(
path: impl AsRef<std::path::Path>,
) -> anyhow::Result<Builder<crate::store::fs::Store>> {
Ok(Self::builder(crate::store::fs::Store::load(path).await?))
db_path: PathBuf,
backend: T,
) -> anyhow::Result<Builder<crate::store::fs::Store<T>>> {
Ok(Self::builder(
crate::store::fs::Store::load_with_backend(path, db_path, backend).await?,
))
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/rpc/client/blobs.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1028,6 +1028,7 @@ mod tests {
net_protocol::Blobs,
provider::{CustomEventSender, EventSender},
rpc::client::{blobs, tags},
store::fs::FileSystemPersistence,
};

type RpcClient = quic_rpc::RpcClient<RpcService>;
Expand Down Expand Up @@ -1113,7 +1114,8 @@ mod tests {
/// Creates a new node with persistent storage
pub async fn persistent(
path: impl AsRef<Path>,
) -> anyhow::Result<Builder<crate::store::fs::Store>> {
) -> anyhow::Result<Builder<crate::store::fs::Store<FileSystemPersistence>>>
{
Ok(Builder {
store: crate::store::fs::Store::load(path).await?,
events: Default::default(),
Expand Down
Loading