pub struct AnalyticsDiagnostic {
pub kind: AnalyticsDiagnosticKind,
pub scope: String,
pub date: Option<String>,
pub event_id: Option<String>,
pub message: String,
pub remedy: Option<String>,
}Expand description
One analytics finding, with everything a surface needs to explain it
(data-model.md §7).
scope is the stable scope id, not the display string: the finding has to
survive the scope’s Display changing, and a payload consumer keys on the id.
date and event_id are Option because a finding is not always about one
day or one event — an invalid period is about the whole series.
Fields§
§kind: AnalyticsDiagnosticKindWhat is wrong.
scope: StringThe stable id of the scope the finding is about.
date: Option<String>The day the finding is about, when it is about one.
event_id: Option<String>The stable event id the finding is about, when it is about one.
message: StringWhat is wrong, in one sentence — the reason half of the #1643 shape.
remedy: Option<String>What the reader can do about it — the remedy half of the #1643 shape.
Implementations§
Source§impl AnalyticsDiagnostic
impl AnalyticsDiagnostic
Sourcepub fn new(
kind: AnalyticsDiagnosticKind,
scope: impl Into<String>,
message: impl Into<String>,
) -> Self
pub fn new( kind: AnalyticsDiagnosticKind, scope: impl Into<String>, message: impl Into<String>, ) -> Self
A finding with its reason; the remedy comes from
AnalyticsDiagnosticKind::default_remedy.
Sourcepub fn about_event(self, event_id: impl Into<String>) -> Self
pub fn about_event(self, event_id: impl Into<String>) -> Self
Name the recorded event the finding is about.
Sourcepub fn with_remedy(self, remedy: impl Into<String>) -> Self
pub fn with_remedy(self, remedy: impl Into<String>) -> Self
Replace the kind’s default remedy with one this finding can be more exact about.
Trait Implementations§
Source§impl Clone for AnalyticsDiagnostic
impl Clone for AnalyticsDiagnostic
Source§impl Debug for AnalyticsDiagnostic
impl Debug for AnalyticsDiagnostic
Source§impl<'de> Deserialize<'de> for AnalyticsDiagnostic
impl<'de> Deserialize<'de> for AnalyticsDiagnostic
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 Display for AnalyticsDiagnostic
impl Display for AnalyticsDiagnostic
impl Eq for AnalyticsDiagnostic
Source§impl Ord for AnalyticsDiagnostic
impl Ord for AnalyticsDiagnostic
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for AnalyticsDiagnostic
impl PartialEq for AnalyticsDiagnostic
Source§impl PartialOrd for AnalyticsDiagnostic
impl PartialOrd for AnalyticsDiagnostic
Source§impl Serialize for AnalyticsDiagnostic
impl Serialize for AnalyticsDiagnostic
impl StructuralPartialEq for AnalyticsDiagnostic
Auto Trait Implementations§
impl Freeze for AnalyticsDiagnostic
impl RefUnwindSafe for AnalyticsDiagnostic
impl Send for AnalyticsDiagnostic
impl Sync for AnalyticsDiagnostic
impl Unpin for AnalyticsDiagnostic
impl UnsafeUnpin for AnalyticsDiagnostic
impl UnwindSafe for AnalyticsDiagnostic
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more