docs.rs failed to build protobuf-1.0.3
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Please check the build logs for more information.
See Builds for ideas on how to fix a failed build, or Metadata for how to configure docs.rs builds.
If you believe this is docs.rs' fault, open an issue.
Visit the last successful build:
protobuf-4.31.0-beta1
rust-protobuf
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
- 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
- Checkout rust-protobuf sources:
git clone git@github.com:stepancheg/rust-protobuf.git -b <branch>
Where branch is:
master
compatible rust masterrust-M.N
compatible with rust version M.N.*, e.g.rust-0.11
for rust 0.11.0
- Compile the project:
cargo build
protoc-gen-rust
binary is generated in target/
folder. protoc-gen-rust
is a rust
plugin for protoc.
- Add
protoc-gen-rust
to $PATH:
PATH="`pwd`/target/debug:$PATH"
- 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
.
- Add rust-protobuf as dependency to your project
Cargo.toml
:
[dependencies.protobuf]
git = "https://github.com/stepancheg/rust-protobuf.git"
- 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:
- descriptor.rs for descriptor.proto (that is part of Google protobuf)
TODO
- Implement some rust-specific options
- Deal better with namespaces
- Protobuf reflection
- Extensions
- Generate stubs for services