Skip to main content

NotificationFields

Struct NotificationFields 

Source
pub struct NotificationFields {
Show 19 fields pub id: String, pub event: EventKind, pub severity: Severity, pub occurred_at_unix_ms: u64, pub service: String, pub instance: String, pub environment: Option<String>, pub cluster: Option<String>, pub driver: String, pub datasource: String, pub operation: String, pub method: Option<String>, pub purpose: Option<String>, pub duration: Duration, pub outcome: String, pub error_kind: Option<String>, pub prepared_sql: Option<String>, pub trace_id: Option<String>, pub slow: bool,
}
Expand description

通知输入;构造后所有文本均由 Notification::new 施加统一边界。

Fields§

§id: String

通知事件标识,供业务渠道关联,不自动提供跨副本去重。

§event: EventKind

触发本次通知的固定事件分类。

§severity: Severity

业务规则指定的严重程度。

§occurred_at_unix_ms: u64

事件发生时间,Unix epoch 毫秒。

§service: String

产生通知的稳定服务名。

§instance: String

产生通知的进程实例身份。

§environment: Option<String>

可选部署环境身份。

§cluster: Option<String>

可选部署集群身份。

§driver: String

产生事件的数据库驱动标识。

§datasource: String

产生事件的数据源目录名称。

§operation: String

触发事件的数据库或连接操作类别。

§method: Option<String>

可选完整 Mapper 方法身份。

§purpose: Option<String>

连接获取事件的可选用途标识。

§duration: Duration

事件关联的数据库活跃时长或连接等待时长,不含通知排队时间。

§outcome: String

操作的稳定结果分类,不应写入原始错误文本。

§error_kind: Option<String>

可选稳定错误分类,不包含数据库响应正文。

§prepared_sql: Option<String>

显式允许携带的 SQL 模板,不得包含绑定参数或凭据。

§trace_id: Option<String>

可选调用链标识,供渠道关联业务事件。

§slow: bool

该操作是否同时命中慢 SQL 阈值,即使主通知事件为执行错误也保留此事实。

Trait Implementations§

Source§

impl Clone for NotificationFields

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Default for NotificationFields

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

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.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

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

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.