commit | 2ef05ef5e346b4dd408d19a3ccba03a9f90ebc3c | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Fri Oct 09 03:23:00 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Oct 09 03:23:00 2020 +0000 |
tree | 67e4a050fab8163cbb84fafee410872d1b1634fd | |
parent | 8b864e123c7e13687530db01146cf22cca3d6755 [diff] | |
parent | e8b7a7337e09f2f00aba9ba621a96cc84272c509 [diff] |
[automerger skipped] Skip ab/6749736 in stage. am: 0ca0a15b95 -s ours am: e8b7a7337e -s ours am skip reason: Change-Id I6bea8abf10b364b405522d53d49dc033d0abfc42 with SHA-1 847dd5114f is in history Original change: https://googleplex-android-review.googlesource.com/c/platform/external/rust/crates/protobuf-codegen/+/12797250 Change-Id: If4b14fa1ef467e4b31583e1928c93334a1026789
This crate contains protobuf code generator and a protoc-gen-rust
protoc
plugin.
protoc-gen-rust
implements standard protobuf protoc
plugin conventions.
Probably you do not want to use it directly in Rust environment, there are easier to use alternatives:
build.rs
of your project which requires only protoc
in $PATH
but not protoc-gen-rust
.protoc
binary(Note protoc
can be invoked programmatically with protoc crate)
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
Protobuf is needed only for code generation, rust-protobuf
runtime does not use protobuf
library.
protoc-gen-rust
program (which is protoc
plugin)It can be installed either from source or with cargo install protobuf
command.
protoc-gen-rust
to $PATHIf you installed it with cargo, it should be
PATH="$HOME/.cargo/bin:$PATH"
protoc --rust_out . foo.proto
This will generate .rs files in current directory.