33 releases

new 0.13.5 Feb 12, 2025
0.13.4 Dec 6, 2024
0.13.3 Sep 21, 2024
0.13.1 Jul 9, 2024
0.2.3 Nov 9, 2017

#188 in Encoding

Download history 1375028/week @ 2024-10-24 1314148/week @ 2024-10-31 1341500/week @ 2024-11-07 1564144/week @ 2024-11-14 1365296/week @ 2024-11-21 1161548/week @ 2024-11-28 1642082/week @ 2024-12-05 1690772/week @ 2024-12-12 883549/week @ 2024-12-19 502331/week @ 2024-12-26 1259080/week @ 2025-01-02 1700349/week @ 2025-01-09 1514948/week @ 2025-01-16 1624984/week @ 2025-01-23 1742959/week @ 2025-01-30 2011042/week @ 2025-02-06

7,230,636 downloads per month
Used in 3,276 crates (1,076 directly)

Apache-2.0

285KB
5K SLoC

Documentation Crate

prost-types

Prost definitions of Protocol Buffers well known types. See the Protobuf reference for more information about well known types.

License

prost-types is distributed under the terms of the Apache License (Version 2.0). prost-types includes code imported from the Protocol Buffers project, which is included under its original (BSD) license.

See LICENSE for details.

Copyright 2017 Dan Burkert


lib.rs:

Protocol Buffers well-known types.

Note that the documentation for the types defined in this crate are generated from the Protobuf definitions, so code examples are not in Rust.

See the Protobuf reference for more information about well-known types.

Any

The well-known [Any] type contains an arbitrary serialized message along with a URL that describes the type of the serialized message. Every message that also implements Name can be serialized to and deserialized from [Any].

Serialization

A message can be serialized using Any::from_msg.

let message = Timestamp::date(2000, 1, 1).unwrap();
let any = Any::from_msg(&message).unwrap();

Deserialization

A message can be deserialized using Any::to_msg.

#
let message = any.to_msg::<Timestamp>().unwrap();

Feature Flags

  • std: Enable integration with standard library. Disable this feature for no_std support. This feature is enabled by default.
  • arbitrary: Enable integration with crate arbitrary. All types on this crate will implement trait Arbitrary.

Dependencies

~165–345KB