mirror of
https://github.com/AppFlowy-IO/AppFlowy.git
synced 2025-08-11 10:21:35 +00:00
24 lines
635 B
Rust
24 lines
635 B
Rust
use flowy_derive::ProtoBuf_Enum;
|
|
use flowy_notification::NotificationBuilder;
|
|
|
|
const OBSERVABLE_SOURCE: &str = "storage";
|
|
|
|
#[derive(ProtoBuf_Enum, Debug, Default)]
|
|
pub(crate) enum StorageNotification {
|
|
#[default]
|
|
FileStorageLimitExceeded = 0,
|
|
|
|
SingleFileLimitExceeded = 1,
|
|
}
|
|
|
|
impl std::convert::From<StorageNotification> for i32 {
|
|
fn from(notification: StorageNotification) -> Self {
|
|
notification as i32
|
|
}
|
|
}
|
|
|
|
#[tracing::instrument(level = "trace")]
|
|
pub(crate) fn make_notification(ty: StorageNotification) -> NotificationBuilder {
|
|
NotificationBuilder::new("appflowy_file_storage_notification", ty, OBSERVABLE_SOURCE)
|
|
}
|