Struct diagnostics_data::Data
source · pub struct Data<D: DiagnosticsData> {
pub data_source: DataSource,
pub metadata: D::Metadata,
pub moniker: String,
pub payload: Option<DiagnosticsHierarchy<D::Key>>,
pub version: u64,
}
Expand description
An instance of diagnostics data with typed metadata and an optional nested payload.
Fields§
§data_source: DataSource
The source of the data.
metadata: D::Metadata
The metadata for the diagnostics payload.
moniker: String
Moniker of the component that generated the payload.
payload: Option<DiagnosticsHierarchy<D::Key>>
Payload containing diagnostics data, if the payload exists, else None.
version: u64
Schema version.
Implementations§
source§impl<D> Data<D>where
D: DiagnosticsData,
impl<D> Data<D>where D: DiagnosticsData,
pub fn dropped_payload_schema(self, error_string: String) -> Data<D>where D: DiagnosticsData,
source§impl Data<Inspect>
impl Data<Inspect>
sourcepub fn for_inspect(
moniker: impl Into<String>,
inspect_hierarchy: Option<DiagnosticsHierarchy>,
timestamp: impl Into<Timestamp>,
component_url: impl Into<String>,
filename: impl Into<String>,
errors: Vec<InspectError>
) -> InspectData
pub fn for_inspect( moniker: impl Into<String>, inspect_hierarchy: Option<DiagnosticsHierarchy>, timestamp: impl Into<Timestamp>, component_url: impl Into<String>, filename: impl Into<String>, errors: Vec<InspectError> ) -> InspectData
Creates a new data instance for inspect.
source§impl Data<Logs>
impl Data<Logs>
sourcepub fn for_logs(
moniker: impl Into<String>,
payload: Option<LogsHierarchy>,
timestamp: impl Into<Timestamp>,
component_url: Option<String>,
severity: impl Into<Severity>,
errors: Vec<LogError>
) -> Self
pub fn for_logs( moniker: impl Into<String>, payload: Option<LogsHierarchy>, timestamp: impl Into<Timestamp>, component_url: Option<String>, severity: impl Into<Severity>, errors: Vec<LogError> ) -> Self
Creates a new data instance for logs.
sourcepub fn msg(&self) -> Option<&str>
pub fn msg(&self) -> Option<&str>
Returns the string log associated with the message, if one exists.
pub fn msg_mut(&mut self) -> Option<&mut String>
pub fn payload_printf_format(&mut self) -> Option<&str>
pub fn payload_printf_args(&mut self) -> Option<&Vec<String>>
pub fn payload_printf(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
pub fn payload_message(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
pub fn payload_keys(&self) -> Option<&DiagnosticsHierarchy<LogsField>>
sourcepub fn payload_keys_strings(&self) -> Box<dyn Iterator<Item = String> + '_>
pub fn payload_keys_strings(&self) -> Box<dyn Iterator<Item = String> + '_>
Returns an iterator over the payload keys as strings with the format “key=value”.
pub fn payload_message_mut( &mut self ) -> Option<&mut DiagnosticsHierarchy<LogsField>>
sourcepub fn file_path(&self) -> Option<&str>
pub fn file_path(&self) -> Option<&str>
Returns the file path associated with the message, if one exists.
sourcepub fn line_number(&self) -> Option<&u64>
pub fn line_number(&self) -> Option<&u64>
Returns the line number associated with the message, if one exists.
Returns the tags associated with the message, if any exist.
sourcepub fn legacy_severity(&self) -> LegacySeverity
pub fn legacy_severity(&self) -> LegacySeverity
The message’s severity.
sourcepub fn dropped_logs(&self) -> Option<u64>
pub fn dropped_logs(&self) -> Option<u64>
Returns number of dropped logs if reported in the message.
sourcepub fn rolled_out_logs(&self) -> Option<u64>
pub fn rolled_out_logs(&self) -> Option<u64>
Returns number of rolled out logs if reported in the message.
pub fn verbosity(&self) -> Option<i8>
pub fn set_legacy_verbosity(&mut self, legacy: i8)
sourcepub fn component_name(&self) -> &str
pub fn component_name(&self) -> &str
Returns the component nam. This only makes sense for v1 components.
Trait Implementations§
source§impl<'de, D: DiagnosticsData> Deserialize<'de> for Data<D>where
D::Metadata: DeserializeOwned,
impl<'de, D: DiagnosticsData> Deserialize<'de> for Data<D>where D::Metadata: DeserializeOwned,
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
source§impl Into<LogMessage> for &Data<Logs>
impl Into<LogMessage> for &Data<Logs>
Convert this Message
to a FIDL representation suitable for sending to LogListenerSafe
.
source§fn into(self) -> LogMessage
fn into(self) -> LogMessage
source§impl Into<LogMessage> for Data<Logs>
impl Into<LogMessage> for Data<Logs>
Convert this Message
to a FIDL representation suitable for sending to LogListenerSafe
.
source§fn into(self) -> LogMessage
fn into(self) -> LogMessage
source§impl Ord for Data<Logs>
impl Ord for Data<Logs>
source§impl<D: PartialEq + DiagnosticsData> PartialEq<Data<D>> for Data<D>where
D::Metadata: PartialEq,
D::Key: PartialEq,
impl<D: PartialEq + DiagnosticsData> PartialEq<Data<D>> for Data<D>where D::Metadata: PartialEq, D::Key: PartialEq,
source§impl PartialOrd<Data<Logs>> for Data<Logs>
impl PartialOrd<Data<Logs>> for Data<Logs>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more