Upgrade capnp 0.20 → 0.25, capnp-rpc 0.20 → 0.25
RPC trait methods changed from &mut self to self: Rc<Self> and return types from Promise<(), Error> to impl Future<Output = Result<...>>. Updated all Server impls across 6 files: DaemonImpl (rpc.rs), NotifyForwarder (channels.rs), and ChannelServerImpl in all channel crates (irc, telegram, tmux, socat). Local pry! macro replaces capnp_rpc::pry to match the new impl Future return type. Warning-clean workspace build. Co-Authored-By: Proof of Concept <poc@bcachefs.org>
This commit is contained in:
parent
382ebc95aa
commit
a421c3c9f3
12 changed files with 221 additions and 192 deletions
|
|
@ -12,8 +12,8 @@ use tokio::net::UnixStream;
|
|||
use tokio_util::compat::TokioAsyncReadCompatExt;
|
||||
use log::{info, warn};
|
||||
|
||||
use std::rc::Rc;
|
||||
use crate::channel_capnp::{channel_client, channel_server};
|
||||
use capnp::capability::Promise;
|
||||
|
||||
// ── Channel notifications ───────────────────────────────────────
|
||||
|
||||
|
|
@ -33,10 +33,10 @@ struct NotifyForwarder {
|
|||
|
||||
impl channel_client::Server for NotifyForwarder {
|
||||
fn notify(
|
||||
&mut self,
|
||||
self: Rc<Self>,
|
||||
params: channel_client::NotifyParams,
|
||||
_results: channel_client::NotifyResults,
|
||||
) -> Promise<(), capnp::Error> {
|
||||
) -> impl std::future::Future<Output = Result<(), capnp::Error>> {
|
||||
if let Ok(params) = params.get() {
|
||||
if let Ok(notifications) = params.get_notifications() {
|
||||
for n in notifications.iter() {
|
||||
|
|
@ -57,7 +57,7 @@ impl channel_client::Server for NotifyForwarder {
|
|||
}
|
||||
}
|
||||
}
|
||||
Promise::ok(())
|
||||
std::future::ready(Ok(()))
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue