pub struct DebugAnnotation {
pub proto_value: Option<Bytes>,
pub dict_entries: Vec<DebugAnnotation>,
pub array_values: Vec<DebugAnnotation>,
pub name_field: Option<NameField>,
pub value: Option<Value>,
pub proto_type_descriptor: Option<ProtoTypeDescriptor>,
}
Expand description
Proto representation of untyped key/value annotations provided in TRACE_EVENT macros. Users of the Perfetto SDK should prefer to use the perfetto::TracedValue API to fill these protos, rather than filling them manually.
Debug annotations are intended for debug use and are not considered a stable API of the trace contents. Trace-based metrics that use debug annotation values are prone to breakage, so please rely on typed TrackEvent fields for these instead.
DebugAnnotations support nested arrays and dictionaries. Each entry is encoded as a single DebugAnnotation message. Only dictionary entries set the “name” field. The TrackEvent message forms an implicit root dictionary.
Example TrackEvent with nested annotations: track_event { debug_annotations { name: “foo” dict_entries { name: “a” bool_value: true } dict_entries { name: “b” int_value: 123 } } debug_annotations { name: “bar” array_values { string_value: “hello” } array_values { string_value: “world” } } }
Next ID: 18. Reserved ID: 15
Fields§
§proto_value: Option<Bytes>
§dict_entries: Vec<DebugAnnotation>
§array_values: Vec<DebugAnnotation>
§name_field: Option<NameField>
Name fields are set only for dictionary entries.
value: Option<Value>
§proto_type_descriptor: Option<ProtoTypeDescriptor>
Used to embed arbitrary proto messages (which are also typically used to represent typed TrackEvent arguments). |proto_type_name| or |proto_type_name_iid| are storing the full name of the proto messages (e.g. .perfetto.protos.DebugAnnotation) and |proto_value| contains the serialised proto messages. See |TracedValue::WriteProto| for more details.
Implementations§
Source§impl DebugAnnotation
impl DebugAnnotation
Sourcepub fn proto_value(&self) -> &[u8] ⓘ
pub fn proto_value(&self) -> &[u8] ⓘ
Returns the value of proto_value
, or the default value if proto_value
is unset.
Trait Implementations§
Source§impl Clone for DebugAnnotation
impl Clone for DebugAnnotation
Source§fn clone(&self) -> DebugAnnotation
fn clone(&self) -> DebugAnnotation
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for DebugAnnotation
impl Debug for DebugAnnotation
Source§impl Default for DebugAnnotation
impl Default for DebugAnnotation
Source§impl Message for DebugAnnotation
impl Message for DebugAnnotation
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8>where
Self: Sized,
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
self
.