Giter VIP home page Giter VIP logo

Comments (6)

dwrensha avatar dwrensha commented on June 20, 2024 1

@drusellers

Step one is to make sure you have the capnp tool installed, as in: https://capnproto.org/install.html

Then the usual way to generate rust code from capnpc-rust is through a build script, as in this example. This invokes capnp compile -o - as a child process and uses the capnpc-rust crate as a library to consume the result.

Alternatively, you can use the capnpc-rust binary target. You need to give the capnp tool a way to find it; one way to do that would be to copy target/release/capnpc-rust into the same directory as the capnp tool and the capnpc-c++ and capnpc-capnp plugins -- for me that's /usr/local/bin/. Then you should be able to do capnp compile -orust foo.capnp.

from capnproto-rust.

mchaput avatar mchaput commented on June 20, 2024

There are examples? Seriously, I can't find any examples of even the most basic usage.

from capnproto-rust.

emberian avatar emberian commented on June 20, 2024

@mchaput looks like they got moved to https://github.com/dwrensha/capnpc-rust

from capnproto-rust.

alexchandel avatar alexchandel commented on June 20, 2024

@dwrensha Could you provide an example of deserializing a capnp message to a Rust struct? The only example in capnpc-rust is of manually extracting the fields.

from capnproto-rust.

dwrensha avatar dwrensha commented on June 20, 2024

There currently is no way to automatically convert between native Rust structs and Cap'n Proto messages. I discussed this a bit here.

from capnproto-rust.

drusellers avatar drusellers commented on June 20, 2024

I'm curious how one even installs capnp-rust and executes it with capnpc?

from capnproto-rust.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.