blob: 515bba8fb7db9f88579c9aaf1a5593f0d14c5a49 [file] [log] [blame]
Chih-Hung Hsiehcfc3a232020-06-10 20:13:05 -07001//! 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")]
9extern crate bytes;
10#[cfg(feature = "with-serde")]
11extern crate serde;
12#[macro_use]
13#[cfg(feature = "with-serde")]
14extern crate serde_derive;
15pub use cached_size::CachedSize;
16#[cfg(feature = "bytes")]
17pub use chars::Chars;
18pub use clear::Clear;
19pub use core::parse_from_bytes;
20#[cfg(feature = "bytes")]
21pub use core::parse_from_carllerche_bytes;
22pub use core::parse_from_reader;
23#[allow(deprecated)]
24pub use core::parse_length_delimited_from;
25#[allow(deprecated)]
26pub use core::parse_length_delimited_from_bytes;
27#[allow(deprecated)]
28pub use core::parse_length_delimited_from_reader;
29pub use core::Message;
30pub use enums::ProtobufEnum;
31pub use error::ProtobufError;
32pub use error::ProtobufResult;
33pub use repeated::RepeatedField;
34pub use singular::SingularField;
35pub use singular::SingularPtrField;
36pub use stream::wire_format;
37pub use stream::CodedInputStream;
38pub use stream::CodedOutputStream;
39pub use unknown::UnknownFields;
40pub use unknown::UnknownFieldsIter;
41pub use unknown::UnknownValue;
42pub use unknown::UnknownValueRef;
43pub use unknown::UnknownValues;
44pub use unknown::UnknownValuesIter;
45
46// generated
47pub mod descriptor;
48pub mod plugin;
49pub mod rustproto;
50
51mod any;
52
53mod clear;
54pub mod compiler_plugin;
55mod core;
56mod enums;
57pub mod error;
58pub mod ext;
59pub mod lazy;
60pub mod reflect;
61mod repeated;
62pub mod rt;
63mod singular;
64pub mod stream;
65pub mod text_format;
66pub mod types;
67pub mod well_known_types;
68
69// used by test
70#[cfg(test)]
71#[path = "../../protobuf-test-common/src/hex.rs"]
72mod hex;
73
74// used by rust-grpc
75pub mod descriptorx;
76
77mod cached_size;
78#[cfg(feature = "bytes")]
79mod chars;
80#[doc(hidden)] // used by codegen
81pub mod rust;
82mod strx;
83mod unknown;
84mod varint;
85mod zigzag;
86
87mod misc;
88
89mod buf_read_iter;
90
91// so `use protobuf::*` could work in mod descriptor and well_known_types
92mod 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)]
121pub const VERSION: &str = "";
122/// This symbol is in generated `version.rs`, include here for IDE
123#[cfg(never)]
124#[doc(hidden)]
125pub const VERSION_IDENT: &str = "";
126include!("../out/version.rs");