tag | 5961ec213a638331d8469fc1bff47aa27f026687 | |
---|---|---|
tagger | The Android Open Source Project <initial-contribution@android.com> | Tue Jan 03 11:24:32 2023 -0800 |
object | b4d87d489f6a851426db8a94bb2690dc302b7a8e |
Android 13.0.0 release 24
commit | b4d87d489f6a851426db8a94bb2690dc302b7a8e | [log] [tgz] |
---|---|---|
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Apr 06 20:37:13 2022 +0000 |
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | Wed Apr 06 20:37:13 2022 +0000 |
tree | eda2c3bcc49d645d0edc2b67d1b0dd8ce05e8ec4 | |
parent | bc9227eceb93d3a8e0b73ae5c45fb7723001a9d1 [diff] | |
parent | dcf8cf0a7e5972255ff126db5995cd19126d880a [diff] |
Snap for 8414339 from dcf8cf0a7e5972255ff126db5995cd19126d880a to tm-qpr1-release Change-Id: Id78ece80058d6ace596357299c6c909580391992
This crate contains protobuf code generator implementation and a protoc-gen-rust
protoc
plugin.
This crate:
protoc-gen-rust
plugin for protoc
commandThis crate is not meant to be used directly, in fact, it does not provide any public API (except for protoc-gen-rust
binary).
Code can be generated with either:
protoc-gen-rust
plugin for protoc
orprotoc-rust
crate (code generator which depends on protoc
binary for parsing of .proto
files)protobuf-codegen-pure
crate, similar API to protoc-rust
, but uses pure rust parser of .proto
files.protoc-gen-rust
plugin for protoc
When non-cargo build system is used, consider using standard protobuf code generation pattern: protoc
command does all the work of handling paths and parsing .proto
files. When protoc
is invoked with --rust_out=
option, it invokes protoc-gen-rust
plugin. provided by this crate.
When building with cargo, consider using protoc-rust
or protobuf-codegen-pure
crates.
protoc-gen-rust
if you have to(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.
This is documentation for version 2 of the crate.
Version 3 of the crate (currently in development) encapsulates both protoc
and pure codegens in this crate.