pub struct Notification { /* private fields */ }Expand description
One query notification (ADR-0363 decision 1): the record
{ kind, description, remedy, operator_id }.
The kind supplies the metadata — code, GQLSTATUS, severity, category,
title and the canonical remedy — so the record stores no copy of it and
the two cannot drift. description carries the instance detail (the
unknown name, the index text, the procedure name); an instance-specific
remedy overrides the kind’s canonical text where the detector can name
the precise action (the exact CREATE INDEX, the deprecated_by
replacement). operator_id is the raising operator’s PlanNode.id,
present only on operator-scoped kinds.
Implementations§
Source§impl Notification
impl Notification
Sourcepub fn new(kind: NotificationKind, description: impl Into<String>) -> Self
pub fn new(kind: NotificationKind, description: impl Into<String>) -> Self
One notification of kind with its instance description; no
instance remedy (the kind’s canonical remedy applies) and no
operator association (statement-scoped until Self::with_operator_id).
Sourcepub fn with_operator_id(self, operator_id: usize) -> Self
pub fn with_operator_id(self, operator_id: usize) -> Self
Attach an operator association — the raising PlanNode.id — the one
way an operator-scoped notification gains operator_id.
Sourcepub fn with_remedy(self, remedy: impl Into<String>) -> Self
pub fn with_remedy(self, remedy: impl Into<String>) -> Self
Override the kind’s canonical remedy with the instance-specific action (the exact runnable statement, the replacement name).
Sourcepub fn kind(&self) -> NotificationKind
pub fn kind(&self) -> NotificationKind
The notification’s kind — the vocabulary row identity.
Sourcepub fn description(&self) -> &str
pub fn description(&self) -> &str
The instance detail — the unknown name, index text, procedure name or warning message.
Sourcepub fn gql_status(&self) -> &'static str
pub fn gql_status(&self) -> &'static str
The kind’s GQLSTATUS value.
Sourcepub fn severity(&self) -> NotificationSeverity
pub fn severity(&self) -> NotificationSeverity
The kind’s severity.
Sourcepub fn category(&self) -> NotificationCategory
pub fn category(&self) -> NotificationCategory
The kind’s category.
Sourcepub fn remedy(&self) -> &str
pub fn remedy(&self) -> &str
The effective remedy: the instance-specific one when the detector supplied it, else the kind’s canonical remedy. Every vocabulary kind carries a remedy, so this is never absent.
Sourcepub fn operator_id(&self) -> Option<usize>
pub fn operator_id(&self) -> Option<usize>
The raising operator’s PlanNode.id, on operator-scoped kinds only.
Trait Implementations§
Source§impl Clone for Notification
impl Clone for Notification
Source§impl Debug for Notification
impl Debug for Notification
impl Eq for Notification
Source§impl PartialEq for Notification
impl PartialEq for Notification
impl StructuralPartialEq for Notification
Auto Trait Implementations§
impl Forget for Notification
impl Freeze for Notification
impl Move for Notification
impl RefUnwindSafe for Notification
impl Send for Notification
impl Sync for Notification
impl Unpin for Notification
impl UnsafeUnpin for Notification
impl UnwindSafe for Notification
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> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.