proto_types/
lib.rs

1#![cfg_attr(docsrs, feature(doc_cfg))]
2#![doc = include_str!("../README.md")]
3
4//! # Feature flags
5#![doc = document_features::document_features!()]
6
7/// Generated rust code from buf.validate protobuf package, with some added methods and structs.
8#[cfg(feature = "protovalidate")]
9pub mod protovalidate;
10
11/// Implementations to allow conversion from well known types to [`cel::Value`](::cel::Value)
12#[cfg(feature = "cel")]
13pub mod cel;
14
15#[cfg(feature = "rpc")]
16mod rpc;
17#[cfg(feature = "rpc")]
18pub use rpc::*;
19
20mod common;
21pub use common::*;
22pub use protobuf::*;
23mod protobuf;
24mod protobuf_impls;
25
26/// Implementations and units for Duration structs.
27pub mod duration;
28
29pub mod timestamp;
30
31mod any;
32mod any_impls;
33
34mod field_mask;
35
36mod field_type;
37#[doc(inline)]
38pub use field_type::FieldType;
39
40mod empty;
41
42mod constants;
43mod conversions;
44mod datetime_internal;
45mod type_url;
46
47use core::{convert::TryFrom, fmt, time};
48use std::str::FromStr;
49
50use prost::{
51  alloc::{format, string::String, vec::Vec},
52  DecodeError, EncodeError, Message, Name,
53};
54pub(crate) use type_url::{type_url_for, TypeUrl};
55
56/// The `Status` type defines a logical error model that is suitable for
57/// different programming environments, including REST APIs and RPC APIs. It is
58/// used by [gRPC](<https://github.com/grpc>). Each `Status` message contains
59/// three pieces of data: error code, error message, and error details.
60///
61/// You can find out more about this error model and how to work with it in the
62/// [API Design Guide](<https://cloud.google.com/apis/design/errors>).
63#[derive(Clone, PartialEq, ::prost::Message)]
64#[cfg_attr(feature = "serde", derive(serde::Serialize, serde::Deserialize))]
65pub struct Status {
66  /// The status code, which should be an enum value of
67  /// [google.rpc.Code][google.rpc.Code].
68  #[prost(int32, tag = "1")]
69  pub code: i32,
70  /// A developer-facing error message, which should be in English. Any
71  /// user-facing error message should be localized and sent in the
72  /// [google.rpc.Status.details][google.rpc.Status.details] field, or localized
73  /// by the client.
74  #[prost(string, tag = "2")]
75  pub message: ::prost::alloc::string::String,
76  /// A list of messages that carry the error details.  There is a common set of
77  /// message types for APIs to use.
78  #[prost(message, repeated, tag = "3")]
79  pub details: ::prost::alloc::vec::Vec<crate::protobuf::Any>,
80}