Skip to content

Commit

Permalink
add stub set_pipeline methods
Browse files Browse the repository at this point in the history
  • Loading branch information
dwrensha committed Mar 2, 2023
1 parent 39b91ea commit 76ac1f9
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
4 changes: 4 additions & 0 deletions capnp-rpc/src/local.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,10 @@ impl ResultsHook for Results {
}
}

fn set_pipeline(&mut self, pipeline: Box<dyn PipelineHook>) {
todo!()
}

fn on_tail_call(&mut self) -> Promise<any_pointer::Pipeline, crate::Error> {
todo!()
}
Expand Down
4 changes: 4 additions & 0 deletions capnp-rpc/src/rpc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2295,6 +2295,10 @@ impl<VatId> ResultsHook for Results<VatId> {
}
}

fn set_pipeline(&mut self, pipeline: Box<dyn PipelineHook>) {
todo!()
}

fn on_tail_call(&mut self) -> Promise<any_pointer::Pipeline, crate::Error> {
todo!()
}
Expand Down
11 changes: 7 additions & 4 deletions capnp/src/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@ pub struct Results<T> {

impl<T> Results<T>
where
T: Owned,
T: Owned + Pipelined,
{
pub fn new(hook: Box<dyn ResultsHook>) -> Self {
Self {
Expand All @@ -240,9 +240,12 @@ where
self.hook.get().unwrap().set_as(other)
}

pub fn tail_call<SubParams>(self, tail_request: Request<SubParams, T>)
-> 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<SubParams>(self, tail_request: Request<SubParams, T>) -> Promise<(), Error> {
self.hook.tail_call(tail_request.hook)
}
}
Expand Down
4 changes: 3 additions & 1 deletion capnp/src/private/capability.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,11 @@ pub trait ResultsHook {
fn get(&mut self) -> crate::Result<any_pointer::Builder<'_>>;
fn allow_cancellation(&self);

fn tail_call(self: Box<Self>, request: Box<dyn RequestHook>) -> Promise<(), crate::Error>;
fn set_pipeline(&mut self, pipeline: Box<dyn PipelineHook>);

fn on_tail_call(&mut self) -> Promise<any_pointer::Pipeline, crate::Error>;

fn tail_call(self: Box<Self>, request: Box<dyn RequestHook>) -> Promise<(), crate::Error>;
fn direct_tail_call(
self: Box<Self>,
request: Box<dyn RequestHook>,
Expand Down

0 comments on commit 76ac1f9

Please sign in to comment.