Skip to content

Commit be55219

Browse files
author
“ramfox”
committed
chore: upgrade to latest iroh and irpc
1 parent ecdf5f2 commit be55219

File tree

4 files changed

+44
-48
lines changed

4 files changed

+44
-48
lines changed

Cargo.lock

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

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ self_cell = "1.1.0"
4141
genawaiter = { version = "0.99.1", features = ["futures03"] }
4242
iroh-base = "0.92"
4343
irpc = { version = "0.8.0", features = ["rpc", "quinn_endpoint_setup", "spans", "stream", "derive"], default-features = false }
44-
iroh-metrics = { version = "0.35" }
44+
iroh-metrics = { version = "0.36" }
4545
redb = { version = "2.6.3", optional = true }
4646
reflink-copy = { version = "0.1.24", optional = true }
4747

@@ -72,4 +72,4 @@ fs-store = ["dep:redb", "dep:reflink-copy"]
7272
[patch.crates-io]
7373
iroh = { git = "https://github.com/n0-computer/iroh", branch = "main" }
7474
iroh-base = { git = "https://github.com/n0-computer/iroh", branch = "main" }
75-
irpc = { git = "https://github.com/n0-computer/irpc.git", branch = "main" }
75+
irpc = { git = "https://github.com/n0-computer/irpc.git", branch = "iroh-0-93" }

src/api.rs

Lines changed: 25 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ impl From<io::Error> for RequestError {
7070
}
7171
}
7272

73-
impl From<irpc::channel::RecvError> for RequestError {
74-
fn from(value: irpc::channel::RecvError) -> Self {
73+
impl From<irpc::channel::mpsc::RecvError> for RequestError {
74+
fn from(value: irpc::channel::mpsc::RecvError) -> Self {
7575
RpcSnafu.into_error(value.into())
7676
}
7777
}
@@ -89,8 +89,14 @@ pub type RequestResult<T> = std::result::Result<T, RequestError>;
8989
pub enum ExportBaoError {
9090
#[snafu(display("send error: {source}"))]
9191
Send { source: irpc::channel::SendError },
92-
#[snafu(display("recv error: {source}"))]
93-
Recv { source: irpc::channel::RecvError },
92+
#[snafu(display("mpsc recv error: {source}"))]
93+
MpscRecv {
94+
source: irpc::channel::mpsc::RecvError,
95+
},
96+
#[snafu(display("oneshot recv error: {source}"))]
97+
OneshotRecv {
98+
source: irpc::channel::oneshot::RecvError,
99+
},
94100
#[snafu(display("request error: {source}"))]
95101
Request { source: irpc::RequestError },
96102
#[snafu(display("io error: {source}"))]
@@ -105,7 +111,8 @@ impl From<ExportBaoError> for Error {
105111
fn from(e: ExportBaoError) -> Self {
106112
match e {
107113
ExportBaoError::Send { source, .. } => Self::Io(source.into()),
108-
ExportBaoError::Recv { source, .. } => Self::Io(source.into()),
114+
ExportBaoError::MpscRecv { source, .. } => Self::Io(source.into()),
115+
ExportBaoError::OneshotRecv { source, .. } => Self::Io(source.into()),
109116
ExportBaoError::Request { source, .. } => Self::Io(source.into()),
110117
ExportBaoError::ExportBaoIo { source, .. } => Self::Io(source),
111118
ExportBaoError::ExportBaoInner { source, .. } => Self::Io(source.into()),
@@ -117,7 +124,8 @@ impl From<ExportBaoError> for Error {
117124
impl From<irpc::Error> for ExportBaoError {
118125
fn from(e: irpc::Error) -> Self {
119126
match e {
120-
irpc::Error::Recv(e) => RecvSnafu.into_error(e),
127+
irpc::Error::MpscRecv(e) => MpscRecvSnafu.into_error(e),
128+
irpc::Error::OneshotRecv(e) => OneshotRecvSnafu.into_error(e),
121129
irpc::Error::Send(e) => SendSnafu.into_error(e),
122130
irpc::Error::Request(e) => RequestSnafu.into_error(e),
123131
irpc::Error::Write(e) => ExportBaoIoSnafu.into_error(e.into()),
@@ -131,9 +139,15 @@ impl From<io::Error> for ExportBaoError {
131139
}
132140
}
133141

134-
impl From<irpc::channel::RecvError> for ExportBaoError {
135-
fn from(value: irpc::channel::RecvError) -> Self {
136-
RecvSnafu.into_error(value)
142+
impl From<irpc::channel::mpsc::RecvError> for ExportBaoError {
143+
fn from(value: irpc::channel::mpsc::RecvError) -> Self {
144+
MpscRecvSnafu.into_error(value)
145+
}
146+
}
147+
148+
impl From<irpc::channel::oneshot::RecvError> for ExportBaoError {
149+
fn from(value: irpc::channel::oneshot::RecvError) -> Self {
150+
OneshotRecvSnafu.into_error(value)
137151
}
138152
}
139153

@@ -200,8 +214,8 @@ impl From<RequestError> for Error {
200214
}
201215
}
202216

203-
impl From<irpc::channel::RecvError> for Error {
204-
fn from(e: irpc::channel::RecvError) -> Self {
217+
impl From<irpc::channel::mpsc::RecvError> for Error {
218+
fn from(e: irpc::channel::mpsc::RecvError) -> Self {
205219
Self::Io(e.into())
206220
}
207221
}

src/provider/events.rs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,8 +138,16 @@ impl From<AbortReason> for ProgressError {
138138
}
139139
}
140140

141-
impl From<irpc::channel::RecvError> for ProgressError {
142-
fn from(value: irpc::channel::RecvError) -> Self {
141+
impl From<irpc::channel::mpsc::RecvError> for ProgressError {
142+
fn from(value: irpc::channel::mpsc::RecvError) -> Self {
143+
ProgressError::Internal {
144+
source: value.into(),
145+
}
146+
}
147+
}
148+
149+
impl From<irpc::channel::oneshot::RecvError> for ProgressError {
150+
fn from(value: irpc::channel::oneshot::RecvError) -> Self {
143151
ProgressError::Internal {
144152
source: value.into(),
145153
}

0 commit comments

Comments
 (0)