Skip to content

Commit df42ef5

Browse files
committed
deps: bump to irpc@main
1 parent 73ca073 commit df42ef5

File tree

7 files changed

+48
-58
lines changed

7 files changed

+48
-58
lines changed

Cargo.lock

Lines changed: 4 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ self_cell = "1.1.0"
4242
genawaiter = { version = "0.99.1", features = ["futures03"] }
4343
iroh-base = "0.90"
4444
reflink-copy = "0.1.24"
45-
irpc = { version = "0.5.0", features = ["rpc", "quinn_endpoint_setup", "message_spans", "stream", "derive"], default-features = false }
45+
irpc = { version = "0.5.0", features = ["rpc", "quinn_endpoint_setup", "spans", "stream", "derive"], default-features = false }
4646
iroh-metrics = { version = "0.35" }
4747

4848
[dev-dependencies]
@@ -69,4 +69,3 @@ default = ["hide-proto-docs"]
6969
iroh = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
7070
iroh-base = { git = "https://github.com/n0-computer/iroh.git", branch = "main" }
7171
irpc = { git = "https://github.com/n0-computer/irpc.git", branch = "main" }
72-
irpc-derive = { git = "https://github.com/n0-computer/irpc.git", branch = "main" }

src/api.rs

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ use iroh::Endpoint;
1919
use irpc::rpc::{listen, Handler};
2020
use n0_snafu::SpanTrace;
2121
use nested_enum_utils::common_fields;
22-
use proto::{Request, ShutdownRequest, SyncDbRequest};
22+
use proto::{BlobsApi, ShutdownRequest, SyncDbRequest};
2323
use ref_cast::RefCast;
2424
use serde::{Deserialize, Serialize};
2525
use snafu::{Backtrace, IntoError, Snafu};
@@ -32,7 +32,7 @@ pub mod remote;
3232
pub mod tags;
3333
pub use crate::{store::util::Tag, util::temp_tag::TempTag};
3434

35-
pub(crate) type ApiClient = irpc::Client<proto::Command, proto::Request, proto::StoreService>;
35+
pub(crate) type ApiClient = irpc::Client<proto::BlobsApi>;
3636

3737
#[common_fields({
3838
backtrace: Option<Backtrace>,
@@ -281,43 +281,43 @@ impl Store {
281281

282282
/// Listen on a quinn endpoint for incoming rpc connections.
283283
pub async fn listen(self, endpoint: quinn::Endpoint) {
284-
let local = self.client.local().unwrap().clone();
285-
let handler: Handler<Request> = Arc::new(move |req, rx, tx| {
284+
let local = self.client.as_local().unwrap().clone();
285+
let handler: Handler<BlobsApi> = Arc::new(move |req, rx, tx| {
286286
let local = local.clone();
287287
Box::pin({
288288
match req {
289-
Request::SetTag(msg) => local.send((msg, tx)),
290-
Request::CreateTag(msg) => local.send((msg, tx)),
291-
Request::DeleteTags(msg) => local.send((msg, tx)),
292-
Request::RenameTag(msg) => local.send((msg, tx)),
293-
Request::ListTags(msg) => local.send((msg, tx)),
294-
295-
Request::ListTempTags(msg) => local.send((msg, tx)),
296-
Request::CreateTempTag(msg) => local.send((msg, tx)),
297-
298-
Request::BlobStatus(msg) => local.send((msg, tx)),
299-
300-
Request::ImportBytes(msg) => local.send((msg, tx)),
301-
Request::ImportByteStream(msg) => local.send((msg, tx, rx)),
302-
Request::ImportBao(msg) => local.send((msg, tx, rx)),
303-
Request::ImportPath(msg) => local.send((msg, tx)),
304-
Request::ListBlobs(msg) => local.send((msg, tx)),
305-
Request::DeleteBlobs(msg) => local.send((msg, tx)),
306-
Request::Batch(msg) => local.send((msg, tx, rx)),
307-
308-
Request::ExportBao(msg) => local.send((msg, tx)),
309-
Request::ExportRanges(msg) => local.send((msg, tx)),
310-
Request::ExportPath(msg) => local.send((msg, tx)),
311-
312-
Request::Observe(msg) => local.send((msg, tx)),
313-
314-
Request::ClearProtected(msg) => local.send((msg, tx)),
315-
Request::SyncDb(msg) => local.send((msg, tx)),
316-
Request::Shutdown(msg) => local.send((msg, tx)),
289+
BlobsApi::SetTag(msg) => local.send((msg, tx)),
290+
BlobsApi::CreateTag(msg) => local.send((msg, tx)),
291+
BlobsApi::DeleteTags(msg) => local.send((msg, tx)),
292+
BlobsApi::RenameTag(msg) => local.send((msg, tx)),
293+
BlobsApi::ListTags(msg) => local.send((msg, tx)),
294+
295+
BlobsApi::ListTempTags(msg) => local.send((msg, tx)),
296+
BlobsApi::CreateTempTag(msg) => local.send((msg, tx)),
297+
298+
BlobsApi::BlobStatus(msg) => local.send((msg, tx)),
299+
300+
BlobsApi::ImportBytes(msg) => local.send((msg, tx)),
301+
BlobsApi::ImportByteStream(msg) => local.send((msg, tx, rx)),
302+
BlobsApi::ImportBao(msg) => local.send((msg, tx, rx)),
303+
BlobsApi::ImportPath(msg) => local.send((msg, tx)),
304+
BlobsApi::ListBlobs(msg) => local.send((msg, tx)),
305+
BlobsApi::DeleteBlobs(msg) => local.send((msg, tx)),
306+
BlobsApi::Batch(msg) => local.send((msg, tx, rx)),
307+
308+
BlobsApi::ExportBao(msg) => local.send((msg, tx)),
309+
BlobsApi::ExportRanges(msg) => local.send((msg, tx)),
310+
BlobsApi::ExportPath(msg) => local.send((msg, tx)),
311+
312+
BlobsApi::Observe(msg) => local.send((msg, tx)),
313+
314+
BlobsApi::ClearProtected(msg) => local.send((msg, tx)),
315+
BlobsApi::SyncDb(msg) => local.send((msg, tx)),
316+
BlobsApi::Shutdown(msg) => local.send((msg, tx)),
317317
}
318318
})
319319
});
320-
listen::<Request>(endpoint, handler).await
320+
listen::<BlobsApi>(endpoint, handler).await
321321
}
322322

323323
pub async fn sync_db(&self) -> RequestResult<()> {

src/api/downloader.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,10 @@ use crate::{
2929

3030
#[derive(Debug, Clone)]
3131
pub struct Downloader {
32-
client: irpc::Client<SwarmMsg, SwarmProtocol, DownloaderService>,
32+
client: irpc::Client<SwarmProtocol>,
3333
}
3434

35-
#[derive(Debug, Clone)]
36-
pub struct DownloaderService;
37-
38-
impl irpc::Service for DownloaderService {}
39-
40-
#[rpc_requests(DownloaderService, message = SwarmMsg, alias = "Msg")]
35+
#[rpc_requests(message = SwarmMsg, alias = "Msg")]
4136
#[derive(Debug, Serialize, Deserialize)]
4237
enum SwarmProtocol {
4338
#[rpc(tx = mpsc::Sender<DownloadProgessItem>)]

src/api/proto.rs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,9 @@ impl HashSpecific for CreateTagMsg {
8686
}
8787
}
8888

89-
#[derive(Debug, Clone)]
90-
pub struct StoreService;
91-
impl irpc::Service for StoreService {}
92-
93-
#[rpc_requests(StoreService, message = Command, alias = "Msg")]
89+
#[rpc_requests(message = Command, alias = "Msg")]
9490
#[derive(Debug, Serialize, Deserialize)]
95-
pub enum Request {
91+
pub enum BlobsApi {
9692
#[rpc(tx = mpsc::Sender<super::Result<Hash>>)]
9793
ListBlobs(ListRequest),
9894
#[rpc(tx = oneshot::Sender<Scope>, rx = mpsc::Receiver<BatchResponse>)]

src/store/fs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1259,7 +1259,7 @@ impl AsRef<Store> for FsStore {
12591259

12601260
impl FsStore {
12611261
fn new(
1262-
sender: irpc::LocalSender<proto::Command, proto::StoreService>,
1262+
sender: irpc::LocalSender<proto::BlobsApi>,
12631263
db: tokio::sync::mpsc::Sender<InternalCommand>,
12641264
) -> Self {
12651265
Self {

src/store/fs/import.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,9 @@ use crate::{
3838
api::{
3939
blobs::{AddProgressItem, ImportMode},
4040
proto::{
41-
HashSpecific, ImportByteStreamMsg, ImportByteStreamRequest, ImportByteStreamUpdate,
42-
ImportBytesMsg, ImportBytesRequest, ImportPathMsg, ImportPathRequest, Scope,
43-
StoreService,
41+
BlobsApi, HashSpecific, ImportByteStreamMsg, ImportByteStreamRequest,
42+
ImportByteStreamUpdate, ImportBytesMsg, ImportBytesRequest, ImportPathMsg,
43+
ImportPathRequest, Scope,
4444
},
4545
},
4646
store::{
@@ -136,12 +136,12 @@ impl std::fmt::Debug for ImportEntry {
136136
}
137137
}
138138

139-
impl Channels<StoreService> for ImportEntry {
139+
impl Channels<BlobsApi> for ImportEntry {
140140
type Tx = mpsc::Sender<AddProgressItem>;
141141
type Rx = NoReceiver;
142142
}
143143

144-
pub type ImportEntryMsg = WithChannels<ImportEntry, StoreService>;
144+
pub type ImportEntryMsg = WithChannels<ImportEntry, BlobsApi>;
145145

146146
impl HashSpecific for ImportEntryMsg {
147147
fn hash(&self) -> Hash {

0 commit comments

Comments
 (0)