blob: 6f5068c76fdb0ba84115be093ff7260b3edcac8b [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
Chih-Hung Hsiehcfc3a232020-06-10 20:13:05 -070051mod clear;
52pub mod compiler_plugin;
53mod core;
54mod enums;
55pub mod error;
56pub mod ext;
57pub mod lazy;
Haibo Huang52aa7852020-07-10 20:23:55 -070058mod lazy_v2;
Chih-Hung Hsiehcfc3a232020-06-10 20:13:05 -070059pub mod reflect;
60mod repeated;
61pub mod rt;
62mod singular;
63pub mod stream;
64pub mod text_format;
65pub mod types;
66pub mod well_known_types;
Haibo Huang52aa7852020-07-10 20:23:55 -070067mod well_known_types_util;
Chih-Hung Hsiehcfc3a232020-06-10 20:13:05 -070068
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;
Chih-Hung Hsiehcfc3a232020-06-10 20:13:05 -070078mod chars;
79#[doc(hidden)] // used by codegen
80pub mod rust;
81mod strx;
82mod unknown;
83mod varint;
84mod zigzag;
85
86mod misc;
87
88mod buf_read_iter;
89
90// so `use protobuf::*` could work in mod descriptor and well_known_types
91mod protobuf {
92 pub use cached_size::CachedSize;
93 pub use clear::Clear;
94 pub use core::*;
95 pub use descriptor;
96 pub use descriptorx;
97 pub use enums::ProtobufEnum;
98 pub use error::*;
99 pub use ext;
100 pub use lazy;
101 pub use reflect;
102 pub use repeated::RepeatedField;
103 pub use rt;
104 pub use singular::SingularField;
105 pub use singular::SingularPtrField;
106 pub use stream::*;
107 pub use text_format;
108 pub use types;
109 pub use unknown::UnknownFields;
110 pub use unknown::UnknownFieldsIter;
111 pub use unknown::UnknownValue;
112 pub use unknown::UnknownValueRef;
113 pub use unknown::UnknownValues;
114 pub use unknown::UnknownValuesIter;
115 pub use well_known_types;
116}
117
118/// This symbol is in generated `version.rs`, include here for IDE
119#[cfg(never)]
120pub const VERSION: &str = "";
121/// This symbol is in generated `version.rs`, include here for IDE
122#[cfg(never)]
123#[doc(hidden)]
124pub const VERSION_IDENT: &str = "";
125include!("../out/version.rs");