devtools_wire_format/generated/rs.devtools.common.rs
1// This file is @generated by prost-build.
2/// A Rust source code location.
3#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
4pub struct Location {
5 /// The file path
6 #[prost(string, optional, tag = "1")]
7 pub file: ::core::option::Option<::prost::alloc::string::String>,
8 /// The Rust module path
9 #[prost(string, optional, tag = "2")]
10 pub module_path: ::core::option::Option<::prost::alloc::string::String>,
11 /// The line number in the source code file.
12 #[prost(uint32, optional, tag = "3")]
13 pub line: ::core::option::Option<u32>,
14 /// The character in `line`.
15 #[prost(uint32, optional, tag = "4")]
16 pub column: ::core::option::Option<u32>,
17}
18/// Metadata associated with an event of span.
19#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
20pub struct Metadata {
21 /// The name of the span or event.
22 #[prost(string, tag = "1")]
23 pub name: ::prost::alloc::string::String,
24 /// Describes the part of the system where the span or event that this
25 /// metadata describes occurred.
26 #[prost(string, tag = "2")]
27 pub target: ::prost::alloc::string::String,
28 /// The Rust source location associated with the span or event.
29 #[prost(message, optional, tag = "3")]
30 pub location: ::core::option::Option<Location>,
31 /// Indicates whether metadata is associated with a span or with an event.
32 #[prost(enumeration = "metadata::Kind", tag = "4")]
33 pub kind: i32,
34 /// Describes the level of verbosity of a span or event.
35 #[prost(enumeration = "metadata::Level", tag = "5")]
36 pub level: i32,
37 /// The names of the key-value fields attached to the
38 /// span or event this metadata is associated with.
39 #[prost(string, repeated, tag = "6")]
40 pub field_names: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
41}
42/// Nested message and enum types in `Metadata`.
43pub mod metadata {
44 /// Indicates whether metadata is associated with a span or with an event.
45 #[derive(
46 Clone,
47 Copy,
48 Debug,
49 PartialEq,
50 Eq,
51 Hash,
52 PartialOrd,
53 Ord,
54 ::prost::Enumeration
55 )]
56 #[repr(i32)]
57 pub enum Kind {
58 /// Indicates metadata is associated with a span.
59 Span = 0,
60 /// Indicates metadata is associated with an event.
61 Event = 1,
62 }
63 impl Kind {
64 /// String value of the enum field names used in the ProtoBuf definition.
65 ///
66 /// The values are not transformed in any way and thus are considered stable
67 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
68 pub fn as_str_name(&self) -> &'static str {
69 match self {
70 Self::Span => "SPAN",
71 Self::Event => "EVENT",
72 }
73 }
74 /// Creates an enum from field names used in the ProtoBuf definition.
75 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
76 match value {
77 "SPAN" => Some(Self::Span),
78 "EVENT" => Some(Self::Event),
79 _ => None,
80 }
81 }
82 }
83 /// Describes the level of verbosity of a span or event.
84 ///
85 /// Corresponds to `Level` in the `tracing` crate.
86 #[derive(
87 Clone,
88 Copy,
89 Debug,
90 PartialEq,
91 Eq,
92 Hash,
93 PartialOrd,
94 Ord,
95 ::prost::Enumeration
96 )]
97 #[repr(i32)]
98 pub enum Level {
99 /// The "error" level.
100 ///
101 /// Designates very serious errors.
102 Error = 0,
103 /// The "warn" level.
104 ///
105 /// Designates hazardous situations.
106 Warn = 1,
107 /// The "info" level.
108 /// Designates useful information.
109 Info = 2,
110 /// The "debug" level.
111 ///
112 /// Designates lower priority information.
113 Debug = 3,
114 /// The "trace" level.
115 ///
116 /// Designates very low priority, often extremely verbose, information.
117 Trace = 4,
118 }
119 impl Level {
120 /// String value of the enum field names used in the ProtoBuf definition.
121 ///
122 /// The values are not transformed in any way and thus are considered stable
123 /// (if the ProtoBuf definition does not change) and safe for programmatic use.
124 pub fn as_str_name(&self) -> &'static str {
125 match self {
126 Self::Error => "ERROR",
127 Self::Warn => "WARN",
128 Self::Info => "INFO",
129 Self::Debug => "DEBUG",
130 Self::Trace => "TRACE",
131 }
132 }
133 /// Creates an enum from field names used in the ProtoBuf definition.
134 pub fn from_str_name(value: &str) -> ::core::option::Option<Self> {
135 match value {
136 "ERROR" => Some(Self::Error),
137 "WARN" => Some(Self::Warn),
138 "INFO" => Some(Self::Info),
139 "DEBUG" => Some(Self::Debug),
140 "TRACE" => Some(Self::Trace),
141 _ => None,
142 }
143 }
144 }
145}
146/// One metadata element registered since the last update.
147#[derive(Clone, PartialEq, Eq, Hash, ::prost::Message)]
148pub struct NewMetadata {
149 /// Unique identifier for `metadata`.
150 #[prost(uint64, optional, tag = "1")]
151 pub id: ::core::option::Option<u64>,
152 /// The metadata payload.
153 #[prost(message, optional, tag = "2")]
154 pub metadata: ::core::option::Option<Metadata>,
155}
156/// A message representing a key-value pair of data associated with a `Span`
157#[derive(Clone, PartialEq, ::prost::Message)]
158pub struct Field {
159 /// The key of the key-value pair.
160 ///
161 /// This is either represented as a string, or as an index into a `Metadata`'s
162 /// array of field name strings.
163 #[prost(string, tag = "1")]
164 pub name: ::prost::alloc::string::String,
165 /// Metadata for the task span that the field came from.
166 #[prost(uint64, tag = "8")]
167 pub metadata_id: u64,
168 /// The value of the key-value pair.
169 #[prost(oneof = "field::Value", tags = "2, 3, 4, 5, 6, 7")]
170 pub value: ::core::option::Option<field::Value>,
171}
172/// Nested message and enum types in `Field`.
173pub mod field {
174 /// The value of the key-value pair.
175 #[derive(Clone, PartialEq, ::prost::Oneof)]
176 pub enum Value {
177 /// A value serialized to a string using `fmt::Debug`.
178 #[prost(string, tag = "2")]
179 DebugVal(::prost::alloc::string::String),
180 /// A string value.
181 #[prost(string, tag = "3")]
182 StrVal(::prost::alloc::string::String),
183 /// An unsigned integer value.
184 #[prost(uint64, tag = "4")]
185 U64Val(u64),
186 /// A signed integer value.
187 #[prost(sint64, tag = "5")]
188 I64Val(i64),
189 /// A boolean value.
190 #[prost(bool, tag = "6")]
191 BoolVal(bool),
192 /// A double (f64) value.
193 #[prost(double, tag = "7")]
194 DoubleVal(f64),
195 }
196}