Coder Social home page Coder Social logo

rust-protobuf's Introduction

rust-protobuf

Build Status

Protobuf implementation in Rust.

  • Written in pure rust
  • Generate rust code
  • Has runtime library for generated code (Coded{Input|Output}Stream impl)
  • Incomplete and unstable

How to use rust-protobuf

  1. Install protobuf for protoc binary.

On OS X Homebrew can be used:

brew install protobuf

On Ubuntu, protobuf-compiler package can be installed:

apt-get install protobuf-compiler
  1. Checkout rust-protobuf sources:
git clone [email protected]:stepancheg/rust-protobuf.git -b <branch>

Where branch is:

  • master compatible rust master
  • rust-M.N compatible with rust version M.N.*, e.g. rust-0.11 for rust 0.11.0
  1. Compile the project:
cd src
./rebuild.sh

protoc-gen-rust binary is generated. protoc-gen-rust is a rust plugin for protoc.

  1. Add protoc-gen-rust to $PATH:
PATH="`pwd`:$PATH"
  1. Generate .rs files:
protoc --rust_out . foo.proto

This will generate .rs files in current directory.

Same procedure is used to regenerate .rs files for rust-protobuf itself, see ./regerate.sh.

  1. Include generated files into your project .rs file:
extern mod protobuf; // depend on rust-protobuf runtime
mod foo; // add generated file to the project

Generated code

Have a look at generated files, used internally in rust-protobuf:

TODO

  • Implement some rust-specific options
  • Deal better with namespaces
  • Store unknown fields
  • Protobuf reflection
  • Extensions
  • default_instance for messages with repeated fields
  • Generate stubs for services
  • Comprehensive test suite
  • Default value

Contact me

@stepancheg on github if you have any questions, suggesions or patches.

rust-protobuf's People

Contributors

stepancheg avatar hansjorg avatar blei avatar ealasu avatar dgalling avatar erickt avatar ademidov avatar erik avatar jansegre avatar janavpetrova avatar jamesluke avatar shulcsm 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.