pub trait DiagnosticsData {
    type Metadata: DeserializeOwned + Serialize + Clone + Send + 'static;
    type Key: AsRef<str> + Clone + DeserializeOwned + Eq + FromStr + Hash + Send + 'static;
    type Error: Clone;

    const DATA_TYPE: DataType;

    // Required methods
    fn component_url(metadata: &Self::Metadata) -> Option<&str>;
    fn timestamp(metadata: &Self::Metadata) -> Timestamp;
    fn errors(metadata: &Self::Metadata) -> &Option<Vec<Self::Error>>;
    fn override_error(metadata: Self::Metadata, error: String) -> Self::Metadata;

    // Provided method
    fn has_errors(metadata: &Self::Metadata) -> bool { ... }
}
Expand description

A trait implemented by marker types which denote “kinds” of diagnostics data.

Required Associated Types§

source

type Metadata: DeserializeOwned + Serialize + Clone + Send + 'static

The type of metadata included in results of this type.

source

type Key: AsRef<str> + Clone + DeserializeOwned + Eq + FromStr + Hash + Send + 'static

The type of key used for indexing node hierarchies in the payload.

source

type Error: Clone

The type of error returned in this metadata.

Required Associated Constants§

source

const DATA_TYPE: DataType

Used to query for this kind of metadata in the ArchiveAccessor.

Required Methods§

source

fn component_url(metadata: &Self::Metadata) -> Option<&str>

Returns the component URL which generated this value.

source

fn timestamp(metadata: &Self::Metadata) -> Timestamp

Returns the timestamp at which this value was recorded.

source

fn errors(metadata: &Self::Metadata) -> &Option<Vec<Self::Error>>

Returns the errors recorded with this value, if any.

source

fn override_error(metadata: Self::Metadata, error: String) -> Self::Metadata

Transforms a Metdata string into a errorful metadata, overriding any other errors.

Provided Methods§

source

fn has_errors(metadata: &Self::Metadata) -> bool

Returns whether any errors are recorded on this value.

Implementors§