protobuf_parse/
lib.rs

1//! # Parse `.proto` files
2//!
3//! Parse `.proto` file definitions, **not** the protobuf text format serialization.
4//!
5//! Files can be parsed using pure Rust parser (mod `pure`)
6//! or using the `protoc` command (mod `protoc`).
7//!
8//! This crate is not meant to be used directly, but rather through the `protobuf-codegen` crate.
9//! If you think this crate might be useful to you,
10//! please [consider creating an issue](https://github.com/stepancheg/rust-protobuf/issues/new),
11//! until that this crate is considered to have **no stable API**.
12
13extern crate core;
14
15mod case_convert;
16mod parse_and_typecheck;
17mod parser;
18mod path;
19mod proto;
20mod proto_path;
21mod protobuf_abs_path;
22mod protobuf_ident;
23mod protobuf_path;
24mod protobuf_rel_path;
25pub(crate) mod protoc;
26pub mod pure;
27mod rel_path;
28mod test_against_protobuf_protos;
29mod which_parser;
30
31// Public API
32// Non-public API used by codegen crate.
33pub use case_convert::*;
34pub use parse_and_typecheck::*;
35pub use parser::Parser;
36pub use proto_path::*;
37use protobuf::reflect::FileDescriptor;
38pub use protobuf_abs_path::*;
39pub use protobuf_ident::*;
40pub use protobuf_rel_path::*;
41
42use crate::pure::model;
43
44#[derive(Clone)]
45pub(crate) struct FileDescriptorPair {
46    pub(crate) parsed: model::FileDescriptor,
47    pub(crate) descriptor_proto: protobuf::descriptor::FileDescriptorProto,
48    pub(crate) descriptor: FileDescriptor,
49}