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 clear; 52 pub mod compiler_plugin; 53 mod core; 54 mod enums; 55 pub mod error; 56 pub mod ext; 57 pub mod lazy; 58 pub mod reflect; 59 mod repeated; 60 pub mod rt; 61 mod singular; 62 pub mod stream; 63 pub mod text_format; 64 pub mod types; 65 pub mod well_known_types; 66 67 // used by test 68 #[cfg(test)] 69 #[path = "../../protobuf-test-common/src/hex.rs"] 70 mod hex; 71 72 // used by rust-grpc 73 pub mod descriptorx; 74 75 mod cached_size; 76 #[cfg(feature = "bytes")] 77 mod chars; 78 #[doc(hidden)] // used by codegen 79 pub mod rust; 80 mod strx; 81 mod unknown; 82 mod varint; 83 mod zigzag; 84 85 mod misc; 86 87 mod buf_read_iter; 88 89 // so `use protobuf::*` could work in mod descriptor and well_known_types 90 mod protobuf { 91 pub use cached_size::CachedSize; 92 pub use clear::Clear; 93 pub use core::*; 94 pub use descriptor; 95 pub use descriptorx; 96 pub use enums::ProtobufEnum; 97 pub use error::*; 98 pub use ext; 99 pub use lazy; 100 pub use reflect; 101 pub use repeated::RepeatedField; 102 pub use rt; 103 pub use singular::SingularField; 104 pub use singular::SingularPtrField; 105 pub use stream::*; 106 pub use text_format; 107 pub use types; 108 pub use unknown::UnknownFields; 109 pub use unknown::UnknownFieldsIter; 110 pub use unknown::UnknownValue; 111 pub use unknown::UnknownValueRef; 112 pub use unknown::UnknownValues; 113 pub use unknown::UnknownValuesIter; 114 pub use well_known_types; 115 } 116 117 /// This symbol is in generated `version.rs`, include here for IDE 118 #[cfg(never)] 119 pub const VERSION: &str = ""; 120 /// This symbol is in generated `version.rs`, include here for IDE 121 #[cfg(never)] 122 #[doc(hidden)] 123 pub const VERSION_IDENT: &str = ""; 124 include!(concat!(env!("OUT_DIR"), "/version.rs")); 125