nrc_protobuf/
lib.rs

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