Registry / serialization / prost-derive

prost-derive

JSON →
library0.14.4rscratesunverified

Generate encoding and decoding implementations for Prost annotated types.

# Cargo.toml [dependencies] prost-derive = "0.14.4"
INSTALL
IMPORT
SIG · PROST-DERIVE
P
prost-derive
serializationrustv0.14.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Message
use prost_derive::Message;

Defines a Protobuf message using Prost derive macros and encodes it.

use prost_derive::Message; #[derive(Message)] #[prost(message)] struct MyMessage { #[prost(int32, tag = "1")] id: i32, #[prost(string, tag = "2")] name: String, } fn main() { let msg = MyMessage { id: 42, name: "foo".into() }; let encoded = msg.encode_to_vec(); println!("Encoded: {:?}", encoded); }
Debug
Known issues
gotchaRequires the `prost` crate as a dependency for runtime encoding/decoding.
fix
Add `prost = "0.14"` to Cargo.toml alongside `prost-derive`.
affects: >=0.14.0
Upgrade
Version history
0.14.4latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
7 hits · last 30 days
node
6
Amazon
1
Resources
prost-derive — cargo add prost-derive · libregistry