devtools_wire_format/generated/
rs.devtools.common.rs

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