Lines Matching +full:rust +full:- +full:src
1 <!-- cargo-sync-readme start -->
10 * using `protoc` command line tool and `protoc-gen-rust` plugin
11 * using this crate `Codegen` with pure rust parser
16 If you are using non-cargo build system (like Bazel), you might prefer
17 using `protoc-gen-rust` plugin for `protoc`.
21 # Protoc parser vs pure rust parser
24 * `protoc`-based parser (`protoc` is a command like utility from Google protobuf)
25 * pure rust parser (`protobuf-parse` crate)
27 `protoc`-based parser is expected to parse `.proto` files very correctly:
30 While there are no known bugs in `protobuf-parse`, it is not tested very well.
31 Also `protobuf-parse` does not implement certain rarely used features of `.proto` parser,
36 [`protoc-bin-vendored`](https://docs.rs/protoc-bin-vendored) crate.
40 ```rust
45 // Use `protoc-bin-vendored` bundled protoc command, optional.
48 .includes(&["src/protos"])
50 .input("src/protos/apple.proto")
51 .input("src/protos/banana.proto")
57 ## How to use `protoc-gen-rust`
62 [protoc crate](https://docs.rs/protoc/%3E=3.0.0-alpha))
72 On Ubuntu, `protobuf-compiler` package can be installed:
75 apt-get install protobuf-compiler
78 Protobuf is needed only for code generation, `rust-protobuf` runtime
81 1) Install `protoc-gen-rust` program (which is `protoc` plugin)
83 It can be installed either from source or with `cargo install protobuf-codegen` command.
85 2) Add `protoc-gen-rust` to $PATH
96 protoc --rust_out . foo.proto
105 rust-protobuf provides two options to do that:
108 Simple script `sed` one-liners can be used to replace these markers with custom annotations.
114 rust-protobuf since version 3 no longer directly supports serde.
116 Rust-protobuf 3 fully supports:
119 [`protobuf-json-mapping`](https://docs.rs/protobuf-json-mapping)
126 [Example project](https://github.com/stepancheg/rust-protobuf/tree/master/protobuf-examples/customi…
127 in the rust-protobuf repository demonstrates how to do it.
129 <!-- cargo-sync-readme end -->