You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct MeasureResultProto {
#[prost(int64, tag = "1")]
pub id: i64,
#[prost(int64, tag = "2")]
pub time: i64,
#[prost(message, optional, tag = "3")]
pub data: ::core::option::Option<super::common::DataValueProto>,
#[prost(message, optional, tag = "4")]
pub filter: ::core::option::Option<super::common::DataValueProto>,
}
DataValueProto is a complex structure, which may be a basic type or json:
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Message)]
pub struct DataValueProto {
#[prost(oneof = "data_value_proto::ValueProto", tags = "1, 2, 3, 4, 5")]
pub value_proto: ::core::option::Option<data_value_proto::ValueProto>,
}
/// Nested message and enum types in `DataValueProto`.
pub mod data_value_proto {
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, ::prost::Oneof)]
pub enum ValueProto {
#[prost(bool, tag = "1")]
Bool(bool),
#[prost(int64, tag = "2")]
Long(i64),
#[prost(double, tag = "3")]
Double(f64),
#[prost(string, tag = "4")]
String(::prost::alloc::string::String),
#[prost(string, tag = "5")]
Json(::prost::alloc::string::String),
}
}
Can I generate a Ref or Cow structure? DataValueProto will be used in many places. I don't want to clone it all the time. I just want to use encode_to_vec to convert it to Vec<u8>.
I have a data structure similar to the following:
DataValueProto
is a complex structure, which may be a basic type orjson
:Can I generate a
Ref
orCow
structure?DataValueProto
will be used in many places. I don't want toclone
it all the time. I just want to useencode_to_vec
to convert it toVec<u8>
.This can save a lot of
Clone
performance. My idea is very similar to #1202 , who implemented it throughCow
.The text was updated successfully, but these errors were encountered: