Skip to content

feat(api): make ApiClient public and add Store::local for custom backends - #259

Open
hboisgibault wants to merge 2 commits into
n0-computer:mainfrom
hboisgibault:sendblob/local-store-ctor
Open

feat(api): make ApiClient public and add Store::local for custom backends#259
hboisgibault wants to merge 2 commits into
n0-computer:mainfrom
hboisgibault:sendblob/local-store-ctor

Conversation

@hboisgibault

@hboisgibault hboisgibault commented Sep 1, 2026

Copy link
Copy Markdown

Motivation

Store was only constructible from in-crate backends (MemStore, FsStore) or via Store::connect (remote). External crates could not back a Store with a custom implementation (e.g. OPFS in the browser/WASM, in-memory test backend) by serving proto::Request on a local irpc channel, because ApiClient and the local constructor were pub(crate).

Changes

  • Make ApiClient (irpc::Client<proto::Request>) public.
  • Add Store::local(client: ApiClient) public constructor: create a Store from a custom local rpc client.
  • Keep Store::from_sender as pub(crate) thin wrapper over Store::local (no breaking change).

Example

let (client, rx) = irpc::channel::local(...); // serve proto::Request with your backend
tokio::spawn(async move { /* handle rx with custom backend, e.g. OPFS */ });
let store = Store::local(client);

henry and others added 2 commits September 1, 2026 14:30
Make ApiClient public and add Store::local so external crates can
implement custom store backends (e.g. OPFS in the browser) by serving
proto::Request on a local channel.
@n0bot n0bot Bot added this to iroh Sep 1, 2026
@github-project-automation github-project-automation Bot moved this to 🚑 Needs Triage in iroh Sep 1, 2026
@hboisgibault hboisgibault changed the title Add local store constructor for SendBlob / expose SendBlob local store initialization feat(api): make ApiClient public and add Store::local for custom backends Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: 🚑 Needs Triage

Development

Successfully merging this pull request may close these issues.

1 participant