pub struct AlertStore { /* private fields */ }Expand description
Alert store for persistence.
Implementations§
Source§impl AlertStore
impl AlertStore
Sourcepub async fn create_rule(&self, rule: &AlertRule) -> Result<()>
pub async fn create_rule(&self, rule: &AlertRule) -> Result<()>
Create an alert rule.
Sourcepub async fn list_rules(&self) -> Result<Vec<AlertRule>>
pub async fn list_rules(&self) -> Result<Vec<AlertRule>>
List all alert rules.
Sourcepub async fn list_enabled_rules(&self) -> Result<Vec<AlertRule>>
pub async fn list_enabled_rules(&self) -> Result<Vec<AlertRule>>
List enabled alert rules.
Sourcepub async fn update_rule(&self, rule: &AlertRule) -> Result<()>
pub async fn update_rule(&self, rule: &AlertRule) -> Result<()>
Update an alert rule.
Sourcepub async fn delete_rule(&self, id: Uuid) -> Result<()>
pub async fn delete_rule(&self, id: Uuid) -> Result<()>
Delete an alert rule.
Sourcepub async fn create_alert(&self, alert: &Alert) -> Result<()>
pub async fn create_alert(&self, alert: &Alert) -> Result<()>
Create an alert.
Sourcepub async fn list_active_alerts(&self) -> Result<Vec<Alert>>
pub async fn list_active_alerts(&self) -> Result<Vec<Alert>>
List active (firing) alerts.
Sourcepub async fn list_recent_alerts(&self, limit: i64) -> Result<Vec<Alert>>
pub async fn list_recent_alerts(&self, limit: i64) -> Result<Vec<Alert>>
List recent alerts (both firing and resolved).
Sourcepub async fn resolve_alert(&self, id: Uuid) -> Result<()>
pub async fn resolve_alert(&self, id: Uuid) -> Result<()>
Resolve an alert.
Auto Trait Implementations§
impl Freeze for AlertStore
impl !RefUnwindSafe for AlertStore
impl Send for AlertStore
impl Sync for AlertStore
impl Unpin for AlertStore
impl !UnwindSafe for AlertStore
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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>
Converts
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>
Converts
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