Expand description
Pure-Rust protobuf kernel. Application API matches Google protobuf v4.
Not crates.io protobuf 4.x (upb/C). Not prost.
Official protoc --rust_out links against __internal::runtime.
ⓘ
pbrs = { git = "https://github.com/mingley/pure-protobuf" }Re-exports§
pub use Singular as ProxiedInRepeated;
Modules§
- codegen
- Generate field-wise typed messages (not DynamicMessage wrappers, not upb).
- copy_
counts - Bench-only user-space copy counters (SB-13, Phase 0 attribution).
- gen_
support - Helpers for plugin-generated typed wrappers around
DynamicMessage. - gencode
- Field-wise generated TestAllTypes + WKT used by the conformance program.
- json
- Proto3 JSON mapping.
- prelude
- Prelude for the Protobuf Rust API.
- rt
- Runtime helpers for generated code. Not a Google upb kernel.
- testdata
- Hand-written typed messages with the v4 accessor shape.
- text
- Protocol buffer text format (textproto).
Macros§
- impl_
generated_ message - Typed message wrapping a
DynamicMessage. Used by plugin gencode and the TestAllTypes wrappers the conformance program drives. - impl_
typed_ message - Trait impls for field-wise generated messages (
merge_bytes/write_to/compute_size). - proto
- proto! enables Rust struct-init syntax for protobuf messages.
Structs§
- Descriptor
Option - One custom option on a file, message, field, enum, or method descriptor.
- Descriptor
Pool - Dynamic
Message - Dynamic
Message Mut - Dynamic
Message View - Enum
Descriptor - Field
Descriptor - File
Descriptor - Map
- Empty is an 8-byte null. Parse appends to a
Vec(last-wins). Lookup uses a lazy index. - MapIter
- MapMut
- MapView
- Message
Descriptor - Method
Descriptor - Parse
Error - An error that happened during parsing.
- Proto
Bytes - Owned protobuf
bytes. - Proto
Str - Shared immutable view of a protobuf
stringfield. May contain invalid UTF-8. - Proto
String - Owned protobuf
string. May contain invalid UTF-8 (C++ interop). - Repeated
- Empty is an 8-byte null.
Box<Vec<_>>so unused TAT collections stay off the struct. - Repeated
Iter - Repeated
Mut - Mutable proxy of a repeated field.
- Repeated
View - View of a repeated field.
- Serialize
Error - An error that happened during serialization.
- Service
Descriptor - Unknown
Enum Value - An integer value wasn’t known for an enum while converting.
- Unknown
Fields - Utf8
Error - The bytes were not valid UTF-8.
Enums§
Constants§
- RECURSION_
LIMIT - Maximum nesting depth for binary, JSON, and text parse.
A payload nested more than this many messages returns
ParseError.
Traits§
- AsMut
- AsView
- Clear
- Clear
AndParse - Copy
From - Enum
- Implemented by generated enum types.
- IntoMut
- Into
Proxied - A value-to-
Proxiedconversion that consumes the input. - Into
View - MapKey
- Types allowed as map keys.
- MapValue
- Types allowed as map values.
- Merge
From - Message
- A trait that all owned message types implement.
- Message
Mut - A trait that all message muts implement.
- Message
Name - The protobuf full name of a generated message (
package.Message). - Message
Type - Marker implemented only by message types.
- Message
View - A trait that all message views implement.
- MutProxied
- A type that can be accessed through a mutable proxy.
- Parse
- Operations related to constructing a message.
- Proto
Put - Used by
proto!list/map literals so a field mutator can take either a repeated element or a map key/value pair. - Proxied
- A type that can be accessed through a reference-like proxy.
- Serialize
- Operations related to reading a message.
- Singular
- Types allowed as a simple field, repeated element, or map value.
- Take
From - WireOut
- Byte sink for binary encode. Implemented for every
BufMut(Vec<u8>,BytesMut, tonicEncodeBuf).
Functions§
- message_
eq - Message equality which may have false-negatives in the face of unknown fields.