31 releases
0.13.3 | Sep 21, 2024 |
---|---|
0.13.1 | Jul 9, 2024 |
0.12.3 | Nov 21, 2023 |
0.11.9 | Apr 12, 2023 |
0.2.3 | Nov 9, 2017 |
#192 in Encoding
5,769,208 downloads per month
Used in 3,041 crates
(1,023 directly)
275KB
4.5K
SLoC
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 forno_std
support. This feature is enabled by default.
Dependencies
~175KB