commit | e8b7a7337e09f2f00aba9ba621a96cc84272c509 | [log] [tgz] |
---|---|---|
author | Xin Li <delphij@google.com> | Fri Oct 09 02:27:11 2020 +0000 |
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | Fri Oct 09 02:27:11 2020 +0000 |
tree | 67e4a050fab8163cbb84fafee410872d1b1634fd | |
parent | 8ad94c0b8a733596f8476fe8c2cc1eb4ed84487f [diff] | |
parent | 0ca0a15b9540b6954d5fc6762f025cea1f8aee86 [diff] |
[automerger skipped] Skip ab/6749736 in stage. am: 0ca0a15b95 -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: Id1254e97a9e03def88789fcbee4fb72d5678de1c
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.