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
5,870,422 downloads per month
Used in 3,068 crates
(1,039 directly)
280KB
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
~180KB