From 76ac1f9bca3df62d9b1e9d99fce65c4de9091e21 Mon Sep 17 00:00:00 2001 From: David Renshaw Date: Thu, 2 Mar 2023 16:11:53 -0500 Subject: [PATCH] add stub set_pipeline methods --- capnp-rpc/src/local.rs | 4 ++++ capnp-rpc/src/rpc.rs | 4 ++++ capnp/src/capability.rs | 11 +++++++---- capnp/src/private/capability.rs | 4 +++- 4 files changed, 18 insertions(+), 5 deletions(-) diff --git a/capnp-rpc/src/local.rs b/capnp-rpc/src/local.rs index 11dc65215..37f1cdfea 100644 --- a/capnp-rpc/src/local.rs +++ b/capnp-rpc/src/local.rs @@ -126,6 +126,10 @@ impl ResultsHook for Results { } } + fn set_pipeline(&mut self, pipeline: Box) { + todo!() + } + fn on_tail_call(&mut self) -> Promise { todo!() } diff --git a/capnp-rpc/src/rpc.rs b/capnp-rpc/src/rpc.rs index 736d37e84..84136c8ea 100644 --- a/capnp-rpc/src/rpc.rs +++ b/capnp-rpc/src/rpc.rs @@ -2295,6 +2295,10 @@ impl ResultsHook for Results { } } + fn set_pipeline(&mut self, pipeline: Box) { + todo!() + } + fn on_tail_call(&mut self) -> Promise { todo!() } diff --git a/capnp/src/capability.rs b/capnp/src/capability.rs index 5252f6e70..af519379c 100644 --- a/capnp/src/capability.rs +++ b/capnp/src/capability.rs @@ -223,7 +223,7 @@ pub struct Results { impl Results where - T: Owned, + T: Owned + Pipelined, { pub fn new(hook: Box) -> Self { Self { @@ -240,9 +240,12 @@ where self.hook.get().unwrap().set_as(other) } - pub fn tail_call(self, tail_request: Request) - -> Promise<(), Error> - { + pub fn set_pipeline(&mut self, pipeline: T::Pipeline) { + // How do we get a PipelineHook out of `pipeline`? + //self.hook.set_pipeline(pipeline) + } + + pub fn tail_call(self, tail_request: Request) -> Promise<(), Error> { self.hook.tail_call(tail_request.hook) } } diff --git a/capnp/src/private/capability.rs b/capnp/src/private/capability.rs index 031f294f6..4782b9353 100644 --- a/capnp/src/private/capability.rs +++ b/capnp/src/private/capability.rs @@ -95,9 +95,11 @@ pub trait ResultsHook { fn get(&mut self) -> crate::Result>; fn allow_cancellation(&self); + fn tail_call(self: Box, request: Box) -> Promise<(), crate::Error>; + fn set_pipeline(&mut self, pipeline: Box); + fn on_tail_call(&mut self) -> Promise; - fn tail_call(self: Box, request: Box) -> Promise<(), crate::Error>; fn direct_tail_call( self: Box, request: Box,