Expand description
Library to read and write protocol buffers data.
Re-exports§
pub use error::ProtobufError;
pub use error::ProtobufResult;
Modules§
- descriptor
- Generated file from
google/protobuf/descriptor.proto
- error
- Protobuf error type
- ext
- Utilities to support “extension” fields.
- lazy
- Lazily initialized data. Used in generated code.
- plugin
- Generated file from
google/protobuf/compiler/plugin.proto
- reflect
- Reflection implementation for protobuf types.
- rt
- Functions used by generated protobuf code. Should not be used by programs written by hands.
- rustproto
- Generated file from
rustproto.proto
- text_
format - Protobuf “text format” implementation.
- types
- Implementations of
ProtobufType
for all types. - well_
known_ types - Generated code for “well known types”
- wire_
format - Serialization constants.
Macros§
- debug_
to_ pb_ print - Impl
PbPrint
if there is aDebug
impl.
Structs§
- Cached
Size - Cached size field used in generated code.
It is always equal to itself to simplify generated code.
(Generated code can use
#[derive(Eq)]
). - Chars
- Thin wrapper around
Bytes
which guarantees that bytes are valid UTF-8 string. - Coded
Input Stream - Buffered read with handy utilities.
- Coded
Output Stream - Buffered write with handy utilities
- Repeated
Field - Wrapper around vector to avoid deallocations on clear.
- Singular
Field - Like
Option<T>
, but keeps the actual element onclear
. - Singular
PtrField - Like
Option<Box<T>>
, but keeps the actual element onclear
. - Unknown
Fields - Hold “unknown” fields in parsed message.
- Unknown
Fields Iter - Iterator over
UnknownFields
- Unknown
Values - Field unknown values.
- Unknown
Values Iter - Iterator over unknown values
Enums§
- Unknown
Value - Unknown value.
- Unknown
Value Ref - Reference to unknown value.
Constants§
- VERSION
- protobuf crate version
- VERSION_
2_ 8_ 0 - This symbol can be referenced to assert that proper version of crate is used
Traits§
- Clear
- anything that can be cleared
- Message
- Trait implemented for all generated structs for protobuf messages.
- PbPrint
- A trait used for pretty printing protobuf message.
- Protobuf
Enum - Trait implemented by all protobuf enum types.
Functions§
- parse_
from_ bytes - Parse message from byte array.
- parse_
from_ carllerche_ bytes - Parse message from
Bytes
object. Resulting message may share references to the passed bytes object. - parse_
from_ reader - Parse message from reader. Parse stops on EOF or when error encountered.
- parse_
length_ delimited_ from Deprecated - Parse length-delimited message from stream.
- parse_
length_ delimited_ from_ bytes Deprecated - Parse length-delimited message from bytes.
- parse_
length_ delimited_ from_ reader Deprecated - Parse length-delimited message from
Read
. - push_
field_ start - Push name to buf.
- push_
message_ start - Push name to buf.