I'm looking at a solution to 'embedding' python and javascript into a Rust
application through RPC, my basic schema looks something like:
@0xc01ea2259855b1a4;
interface Executor {
ping @0 () -> (result :Bool);
getFunction @1 [I, O] (hashId :FunctionDescriptor) -> (fn :Function(I, O));
}
struct FunctionDescriptor {
id @0 :Text;
hash @1 :Data;
lang @2 :Language;
}
enum Language {
python @0;
javascript @1;
}
interface Function(I, O) {
call @0 (input :I) -> (output :O);
}
The compiler will happily generate rust code for me; although it seems to
me I need to somehow constrain the generic I and O. In my model, a Rust
client will call a Python Executor, attempt to acquire a concrete function,
which might fail if the python server cannot provide that specific concrete
implementation.
Should I use generics in this way; or use AnyPointers?
--
You received this message because you are subscribed to the Google Groups
"Cap'n Proto" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/capnproto/6fa52867-c879-4f84-b10e-0ef44e07c0e2%40googlegroups.com.