pub struct Alert {
pub id: AlertId,
pub fingerprint: String,
pub severity: Severity,
pub title: String,
pub body: Option<String>,
pub connector: Option<ConnectorId>,
pub account: Option<AccountId>,
pub state: AlertState,
pub raised_at: OffsetDateTime,
pub resolved_at: Option<OffsetDateTime>,
}Fields§
§id: AlertId§fingerprint: StringStable identity of the problem, not of this occurrence. Two raises with the same fingerprint are the same alert, so the user is not notified twice.
severity: Severity§title: String§body: Option<String>§connector: Option<ConnectorId>§account: Option<AccountId>§state: AlertState§raised_at: OffsetDateTime§resolved_at: Option<OffsetDateTime>Implementations§
Source§impl Alert
impl Alert
pub fn new( fingerprint: impl Into<String>, severity: Severity, title: impl Into<String>, raised_at: OffsetDateTime, ) -> Self
pub fn with_body(self, body: impl Into<String>) -> Self
pub fn with_connector(self, connector: ConnectorId) -> Self
Sourcepub fn is_visible(&self) -> bool
pub fn is_visible(&self) -> bool
Whether this alert should currently be shown to the user.
pub fn resolve(&mut self, at: OffsetDateTime)
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>,
Deserialize this value from the given Serde deserializer. Read more
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
Mutably borrows from an owned value. Read more