go-capnp icon indicating copy to clipboard operation
go-capnp copied to clipboard

can't extract field of type anyPointer into a Go capnp.Client

Open CGamesPlay opened this issue 5 years ago • 1 comments

The pogs module doesn't have seem to have support for anyPointer. When we have a known interface, we can deserialize into a capnp.Client object, however the module cannot deserialize anyPointer into anything.

I believe the fix is as simple as adding the anyPointer type to this line, but I'm not sure: https://github.com/capnproto/go-capnproto2/blob/master/pogs/extract.go#L397

Use case: my schema looks like this. My goal is to send a set of capabilities across the wire, but in a dynamic fashion. I have code working for this that doesn't use pogs, so I know the concept works.

struct Interface @0xaa6a48266712f6db {
  id @0 :UInt64;
  capability @1 :Capability;
}

CGamesPlay avatar Sep 11 '20 13:09 CGamesPlay

SGTM, and agreed that would be the function that would be changed. Happy to review a PR for this.

zombiezen avatar Sep 13 '20 15:09 zombiezen