Skip to main content

Crate buffa_types

Crate buffa_types 

Source
Expand description

Protobuf well-known types for buffa.

This crate provides Rust types for Google’s well-known .proto types:

§Usage

use buffa_types::google::protobuf::Timestamp;
use buffa::Message;

let ts = Timestamp { seconds: 1_000_000_000, nanos: 0, ..Default::default() };
let bytes = ts.encode_to_vec();
let decoded = Timestamp::decode_from_slice(&bytes).unwrap();
assert_eq!(ts, decoded);

§Ergonomic helpers

Common Rust type conversions are provided as trait impls:

Re-exports§

pub use google::protobuf::Any;
pub use google::protobuf::Duration;
pub use google::protobuf::Empty;
pub use google::protobuf::FieldMask;
pub use google::protobuf::ListValue;
pub use google::protobuf::NullValue;
pub use google::protobuf::Struct;
pub use google::protobuf::Timestamp;
pub use google::protobuf::Value;

Modules§

google

Enums§

DurationError
Errors that can occur when converting a protobuf Duration to a Rust type.
TimestampError
Errors that can occur when converting a Timestamp to a Rust time type.

Functions§

register_wkt_types
Registers all well-known types with the given AnyRegistry.