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§

buffer
Types to support writing to a contiguous byte buffer.
encoding
Protobuf encodings for Rust types.
inplace
Provides an Option-like type for constructing values in place.
message
Type-erased protobuf message support.
oneof
Encoding support for protobuf oneof fields, which are derived from Rust enums.
prost
Support for encoding Prost types as Mesh types.
protobuf
Tools to encode and decode protobuf messages.
protofile
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
Table-based message encoding and decoding.
transparent
Transparent encoding for types that are a wrapper around another type.

Macros§

inplace
Constructs a possibly-initialized crate::inplace::InplaceOption on the stack from an Option<T>.
inplace_none
Constructs an uninitialized crate::inplace::InplaceOption on the stack.
inplace_some
Constructs an initialized crate::inplace::InplaceOption on the stack from a T.
os_resource
Implements DefaultEncoding for OS resources.

Structs§

EncodeAs
Wrapper type to easily support custom mesh encoding.
Error
A decoding error.
SerializedMessage
A serialized message, consisting of binary data and a list of resources.
Timestamp
A timestamp representing a point in UTC time with nanosecond resolution.

Enums§

NoResources
An empty resources type, used when an encoding does not require any external resources (such as files or mesh channels).

Traits§

CopyExtend
Trait for collections that can be extended by a slice of T: Copy.
DefaultEncoding
Associates the default encoder/decoder type for converting an object to/from protobuf format.
DescribedProtobuf
Trait for types implementing Protobuf and having an associated protobuf message description.
FieldDecode
The FieldEncode trait provides a field decoder for type T.
FieldEncode
The FieldEncode trait provides a field encoder for type T.
MessageDecode
The MessageEncode trait provides a message decoder for type T.
MessageEncode
The MessageEncode trait provides a message encoder for type T.
PackedDecode
Methods for decoding a packed field.
PackedEncode
Encoder methods for writing packed fields.
Protobuf
Trait for types that can be encoded and decoded as a protobuf message.
ResultExt
Extension trait to add type context to Error.

Functions§

decode
Decodes a message with its default encoding.
encode
Encodes a message with its default encoding.
merge
Merges message fields into an existing message.

Type Aliases§

Result
A decoding result.

Derive Macros§

Protobuf