pub struct Alert {
pub class: AlertClass,
pub severity: AlertSeverity,
pub deadline: Option<Timestamp>,
pub params: BTreeMap<String, String>,
}Expand description
One alert that is true at an instant.
Pure data: a class, its severity, the deadline that produced it (for the pre-armable classes),
and the parameters a client interpolates into its own catalog string. Never a localized
string — the copy is a notification.* catalog key the client owns.
Fields§
§class: AlertClassWhich alert this is.
severity: AlertSeverityAlertClass::severity for class, carried so a consumer that only
deserializes the record does not have to re-derive it.
deadline: Option<Timestamp>The instant whose passing made this alert true, for the pre-armable classes; None for
the three whose condition is server-held and has no device-computable deadline.
params: BTreeMap<String, String>Parameters for the client’s catalog string — plain strings, deterministically ordered.
The keys in use are count (sync_stale, quarantine_pending, drop_pending),
days_behind (sync_stale), grace (quota_grace_expiring), and snooze_budget
(available / spent) plus recovery (check / rewrap), both of which
recovery_check_due always carries. Each is documented at the predicate that sets it.
Implementations§
Source§impl Alert
impl Alert
Sourcepub const fn blocks_critical_flow(&self) -> bool
pub const fn blocks_critical_flow(&self) -> bool
Alerts are advisory by construction: no alert blocks sync, unlock, upload, or any
critical flow. const false for every alert, so the “never blocks” rule is a
compile-time property of the type rather than a convention reviewers have to police —
the same trick
VerificationState::blocks_critical_flow uses
for the recovery prompt.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Alert
impl<'de> Deserialize<'de> for Alert
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>,
impl Eq for Alert
impl StructuralPartialEq for Alert
Auto Trait Implementations§
impl Freeze for Alert
impl RefUnwindSafe for Alert
impl Send for Alert
impl Sync for Alert
impl Unpin for Alert
impl UnsafeUnpin for Alert
impl UnwindSafe for Alert
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more