GithubHelp home page GithubHelp logo

tempbottle / rust-protobuf Goto Github PK

View Code? Open in Web Editor NEW

This project forked from stepancheg/rust-protobuf

0.0 1.0 0.0 4.5 MB

Rust implementation of Google protocol buffers

License: BSD 2-Clause "Simplified" License

Shell 0.26% Rust 94.31% C++ 0.40% Protocol Buffer 5.03%

rust-protobuf's Introduction

rust-protobuf

Build Status crates.io version License

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:
cargo build

protoc-gen-rust binary is generated in target/ folder. protoc-gen-rust is a rust plugin for protoc.

  1. Add protoc-gen-rust to $PATH:
PATH="`pwd`/target/debug:$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. Add rust-protobuf as dependency to your project Cargo.toml:
[dependencies.protobuf]

git = "https://github.com/stepancheg/rust-protobuf.git"
  1. Include generated files into your project .rs file:
extern crate 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
  • Protobuf reflection
  • Extensions
  • Generate stubs for services

rust-protobuf's People

Contributors

ademidov avatar aleksandrpak avatar arjantop avatar blei avatar bonifaido avatar borntyping avatar dgalling avatar ealasu avatar erickt avatar erik avatar hansjorg avatar jamesluke avatar janavpetrova avatar jansegre avatar jimmycuadra avatar kornholi avatar mathewprokos avatar meh avatar rajatgoel avatar rozaliev avatar shulcsm avatar stepancheg avatar steveklabnik avatar syakhmi avatar tamird avatar texitoi avatar thijsc 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.