32 releases

new 0.13.4 Dec 6, 2024
0.13.3 Sep 21, 2024
0.13.2 Aug 30, 2024
0.13.1 Jul 9, 2024
0.2.3 Nov 9, 2017

#186 in Encoding

Download history 1249201/week @ 2024-08-21 1148784/week @ 2024-08-28 1318210/week @ 2024-09-04 1224333/week @ 2024-09-11 1219182/week @ 2024-09-18 1321767/week @ 2024-09-25 1343591/week @ 2024-10-02 1357693/week @ 2024-10-09 1447831/week @ 2024-10-16 1399431/week @ 2024-10-23 1323032/week @ 2024-10-30 1318251/week @ 2024-11-06 1524352/week @ 2024-11-13 1448424/week @ 2024-11-20 1102097/week @ 2024-11-27 1532959/week @ 2024-12-04

5,870,422 downloads per month
Used in 3,068 crates (1,039 directly)

Apache-2.0

280KB
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 projet, 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.

Dependencies

~180KB