diff --git a/src/net_protocol.rs b/src/net_protocol.rs index 31b92386f..83d4c72ab 100644 --- a/src/net_protocol.rs +++ b/src/net_protocol.rs @@ -153,27 +153,30 @@ impl Builder { } } -impl Blobs { - /// Create a new memory-backed Blobs protocol handler. - pub fn memory() -> Builder { +impl Blobs { + /// Create a new Blobs protocol handler builder, given a store. + pub fn builder(store: S) -> Builder { Builder { - store: crate::store::mem::Store::new(), + store, events: None, gc_config: None, } } } +impl Blobs { + /// Create a new memory-backed Blobs protocol handler. + pub fn memory() -> Builder { + Self::builder(crate::store::mem::Store::new()) + } +} + impl Blobs { /// Load a persistent Blobs protocol handler from a path. pub async fn persistent( path: impl AsRef, ) -> anyhow::Result> { - Ok(Builder { - store: crate::store::fs::Store::load(path).await?, - events: None, - gc_config: None, - }) + Ok(Self::builder(crate::store::fs::Store::load(path).await?)) } } diff --git a/src/store/fs/tables.rs b/src/store/fs/tables.rs index afbf8b66f..d49dd42e7 100644 --- a/src/store/fs/tables.rs +++ b/src/store/fs/tables.rs @@ -83,8 +83,8 @@ pub(super) struct ReadOnlyTables { pub inline_outboard: redb::ReadOnlyTable, } -impl<'txn> ReadOnlyTables { - pub fn new(tx: &'txn redb::ReadTransaction) -> std::result::Result { +impl ReadOnlyTables { + pub fn new(tx: &redb::ReadTransaction) -> std::result::Result { Ok(Self { blobs: tx.open_table(BLOBS_TABLE)?, tags: tx.open_table(TAGS_TABLE)?,