Crate mesh_protobuf
source ·Expand description
Low-level functionality to serializing and deserializing mesh messages.
Most code won’t use this directly but will instead use the
Protobuf
derive macro.
The encoding used is a superset of protobuf, allowing protobuf clients and mesh to interoperate for a subset of types. This includes an optional extension to allow external resources such as file descriptors to be referenced by messages.
This is used instead of serde in order to serialize objects by value. The serde API takes values by reference, which makes it difficult to support values, such as ports, handles, and file descriptors, whose ownership is to be transferred to the target node.
Modules§
- Types to support writing to a contiguous byte buffer.
- Protobuf encodings for Rust types.
- Provides an
Option
-like type for constructing values in place. - Type-erased protobuf message support.
- Encoding support for protobuf
oneof
fields, which are derived from Rust enums. - Support for encoding Prost types as Mesh types.
- Tools to encode and decode protobuf messages.
- Definitions for describing the format protobuf messages. These can be used to generate
.proto
files that are binary compatible with the associated Rust types. - Table-based message encoding and decoding.
- Transparent encoding for types that are a wrapper around another type.
Macros§
- Constructs a possibly-initialized
crate::inplace::InplaceOption
on the stack from anOption<T>
. - Constructs an uninitialized
crate::inplace::InplaceOption
on the stack. - Constructs an initialized
crate::inplace::InplaceOption
on the stack from aT
. - Implements
DefaultEncoding
for OS resources.
Structs§
- Wrapper type to easily support custom mesh encoding.
- A decoding error.
- A serialized message, consisting of binary data and a list of resources.
- A timestamp representing a point in UTC time with nanosecond resolution.
Enums§
- An empty resources type, used when an encoding does not require any external resources (such as files or mesh channels).
Traits§
- Trait for collections that can be extended by a slice of
T: Copy
. - Associates the default encoder/decoder type for converting an object to/from protobuf format.
- Trait for types implementing
Protobuf
and having an associated protobuf message description. - Marker trait indicating that an encoded value of
T
can be decoded as aSelf
. - The
FieldEncode
trait provides a field decoder for typeT
. - The
FieldEncode
trait provides a field encoder for typeT
. - The
MessageEncode
trait provides a message decoder for typeT
. - The
MessageEncode
trait provides a message encoder for typeT
. - Methods for decoding a packed field.
- Encoder methods for writing packed fields.
- Trait for types that can be encoded and decoded as a protobuf message.
- Extension trait to add type context to
Error
. - Marker trait indicating that an encoded value of
Self
can be decoded as aT
.
Functions§
- Decodes a message with its default encoding.
- Encodes a message with its default encoding.
- Merges message fields into an existing message.
Type Aliases§
- A decoding result.