1 //! Library to read and write protocol buffers data.
2 
3 #![deny(missing_docs)]
4 #![deny(intra_doc_link_resolution_failure)]
5 // Because we need compat with Rust 1.26
6 #![allow(bare_trait_objects)]
7 
8 #[cfg(feature = "bytes")]
9 extern crate bytes;
10 #[cfg(feature = "with-serde")]
11 extern crate serde;
12 #[macro_use]
13 #[cfg(feature = "with-serde")]
14 extern crate serde_derive;
15 pub use cached_size::CachedSize;
16 #[cfg(feature = "bytes")]
17 pub use chars::Chars;
18 pub use clear::Clear;
19 pub use core::parse_from_bytes;
20 #[cfg(feature = "bytes")]
21 pub use core::parse_from_carllerche_bytes;
22 pub use core::parse_from_reader;
23 #[allow(deprecated)]
24 pub use core::parse_length_delimited_from;
25 #[allow(deprecated)]
26 pub use core::parse_length_delimited_from_bytes;
27 #[allow(deprecated)]
28 pub use core::parse_length_delimited_from_reader;
29 pub use core::Message;
30 pub use enums::ProtobufEnum;
31 pub use error::ProtobufError;
32 pub use error::ProtobufResult;
33 pub use repeated::RepeatedField;
34 pub use singular::SingularField;
35 pub use singular::SingularPtrField;
36 pub use stream::wire_format;
37 pub use stream::CodedInputStream;
38 pub use stream::CodedOutputStream;
39 pub use unknown::UnknownFields;
40 pub use unknown::UnknownFieldsIter;
41 pub use unknown::UnknownValue;
42 pub use unknown::UnknownValueRef;
43 pub use unknown::UnknownValues;
44 pub use unknown::UnknownValuesIter;
45 
46 // generated
47 pub mod descriptor;
48 pub mod plugin;
49 pub mod rustproto;
50 
51 mod any;
52 
53 mod clear;
54 pub mod compiler_plugin;
55 mod core;
56 mod enums;
57 pub mod error;
58 pub mod ext;
59 pub mod lazy;
60 pub mod reflect;
61 mod repeated;
62 pub mod rt;
63 mod singular;
64 pub mod stream;
65 pub mod text_format;
66 pub mod types;
67 pub mod well_known_types;
68 
69 // used by test
70 #[cfg(test)]
71 #[path = "../../protobuf-test-common/src/hex.rs"]
72 mod hex;
73 
74 // used by rust-grpc
75 pub mod descriptorx;
76 
77 mod cached_size;
78 #[cfg(feature = "bytes")]
79 mod chars;
80 #[doc(hidden)] // used by codegen
81 pub mod rust;
82 mod strx;
83 mod unknown;
84 mod varint;
85 mod zigzag;
86 
87 mod misc;
88 
89 mod buf_read_iter;
90 
91 // so `use protobuf::*` could work in mod descriptor and well_known_types
92 mod protobuf {
93     pub use cached_size::CachedSize;
94     pub use clear::Clear;
95     pub use core::*;
96     pub use descriptor;
97     pub use descriptorx;
98     pub use enums::ProtobufEnum;
99     pub use error::*;
100     pub use ext;
101     pub use lazy;
102     pub use reflect;
103     pub use repeated::RepeatedField;
104     pub use rt;
105     pub use singular::SingularField;
106     pub use singular::SingularPtrField;
107     pub use stream::*;
108     pub use text_format;
109     pub use types;
110     pub use unknown::UnknownFields;
111     pub use unknown::UnknownFieldsIter;
112     pub use unknown::UnknownValue;
113     pub use unknown::UnknownValueRef;
114     pub use unknown::UnknownValues;
115     pub use unknown::UnknownValuesIter;
116     pub use well_known_types;
117 }
118 
119 /// This symbol is in generated `version.rs`, include here for IDE
120 #[cfg(never)]
121 pub const VERSION: &str = "";
122 /// This symbol is in generated `version.rs`, include here for IDE
123 #[cfg(never)]
124 #[doc(hidden)]
125 pub const VERSION_IDENT: &str = "";
126 include!(concat!(env!("OUT_DIR"), "/version.rs"));
127