Code Monkey home page Code Monkey logo

prost_example's Introduction

Prost Example

This is a sample rust application showing how to build and use protobufs with prost in rust

Build requirements

protoc installation instructions

Just in case the link goes dead, here's the instructions

Linux, using apt or apt-get, for example:

$ apt install -y protobuf-compiler
$ protoc --version  # Ensure compiler version is 3+

MacOS, using Homebrew:

$ brew install protobuf
$ protoc --version  # Ensure compiler version is 3+

build.rs

The build.rs is the main entry point for building the protobuf files. For this example, we're using the walkdir crate to get the full path for all the .proto files. Normally, you'd specify all of the files in the first slice, but I'm lazy like that.

Using the protobufs

You'll need to recreate your package structure using mod blocks. It's useful to do this in a lib.rs for your project. See src/lib.rs for an example.

##Generated code location debug/build/prost_example-{}/out/

The build directory varies.

prost_example's People

Contributors

krlohnes avatar

Watchers

 avatar

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.