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,

source

pub fn dropped_payload_schema(self, error_string: String) -> Data<D>where D: DiagnosticsData,

source§

impl Data<Inspect>

source

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>

source

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.

source

pub fn msg(&self) -> Option<&str>

Returns the string log associated with the message, if one exists.

source

pub fn msg_mut(&mut self) -> Option<&mut String>

source

pub fn payload_printf_format(&mut self) -> Option<&str>

source

pub fn payload_printf_args(&mut self) -> Option<&Vec<String>>

source

pub fn payload_printf(&self) -> Option<&DiagnosticsHierarchy<LogsField>>

source

pub fn payload_message(&self) -> Option<&DiagnosticsHierarchy<LogsField>>

source

pub fn payload_keys(&self) -> Option<&DiagnosticsHierarchy<LogsField>>

source

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”.

source

pub fn payload_message_mut( &mut self ) -> Option<&mut DiagnosticsHierarchy<LogsField>>

source

pub fn file_path(&self) -> Option<&str>

Returns the file path associated with the message, if one exists.

source

pub fn line_number(&self) -> Option<&u64>

Returns the line number associated with the message, if one exists.

source

pub fn pid(&self) -> Option<u64>

Returns the pid associated with the message, if one exists.

source

pub fn tid(&self) -> Option<u64>

Returns the tid associated with the message, if one exists.

source

pub fn tags(&self) -> Option<&Vec<String>>

Returns the tags associated with the message, if any exist.

source

pub fn legacy_severity(&self) -> LegacySeverity

The message’s severity.

source

pub fn severity(&self) -> Severity

Returns the severity level of this log.

source

pub fn dropped_logs(&self) -> Option<u64>

Returns number of dropped logs if reported in the message.

source

pub fn rolled_out_logs(&self) -> Option<u64>

Returns number of rolled out logs if reported in the message.

source

pub fn verbosity(&self) -> Option<i8>

source

pub fn set_legacy_verbosity(&mut self, legacy: i8)

source

pub fn component_name(&self) -> &str

Returns the component nam. This only makes sense for v1 components.

Trait Implementations§

source§

impl<D: Clone + DiagnosticsData> Clone for Data<D>where D::Metadata: Clone, D::Key: Clone,

source§

fn clone(&self) -> Data<D>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D: Debug + DiagnosticsData> Debug for Data<D>where D::Metadata: Debug, D::Key: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

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>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Data<Logs>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Into<LogMessage> for &Data<Logs>

Convert this Message to a FIDL representation suitable for sending to LogListenerSafe.

source§

fn into(self) -> LogMessage

Converts this type into the (usually inferred) input type.
source§

impl Into<LogMessage> for Data<Logs>

Convert this Message to a FIDL representation suitable for sending to LogListenerSafe.

source§

fn into(self) -> LogMessage

Converts this type into the (usually inferred) input type.
source§

impl Ord for Data<Logs>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere Self: Sized + PartialOrd<Self>,

Restrict a value to a certain interval. Read more
source§

impl<D: PartialEq + DiagnosticsData> PartialEq<Data<D>> for Data<D>where D::Metadata: PartialEq, D::Key: PartialEq,

source§

fn eq(&self, other: &Data<D>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd<Data<Logs>> for Data<Logs>

source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl<D: DiagnosticsData> Serialize for Data<D>where D::Metadata: Serialize,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Data<Logs>

source§

impl<D: DiagnosticsData> StructuralPartialEq for Data<D>

Auto Trait Implementations§

§

impl<D> RefUnwindSafe for Data<D>where <D as DiagnosticsData>::Key: RefUnwindSafe, <D as DiagnosticsData>::Metadata: RefUnwindSafe,

§

impl<D> Send for Data<D>

§

impl<D> Sync for Data<D>where <D as DiagnosticsData>::Key: Sync, <D as DiagnosticsData>::Metadata: Sync,

§

impl<D> Unpin for Data<D>where <D as DiagnosticsData>::Key: Unpin, <D as DiagnosticsData>::Metadata: Unpin,

§

impl<D> UnwindSafe for Data<D>where <D as DiagnosticsData>::Key: UnwindSafe, <D as DiagnosticsData>::Metadata: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,