Moved action type into action module.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s

This commit is contained in:
2026-02-07 22:45:18 -05:00
parent 3d19493763
commit 5d8624656a
9 changed files with 11 additions and 21 deletions

47
src/action/action_type.rs Normal file
View File

@@ -0,0 +1,47 @@
use super::MsgAction;
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub enum Action {
Addition,
Create,
Delete,
Error,
OnAddition,
OnDelete,
OnQuery,
OnUpdate,
Query,
Records,
Register,
Reply,
Show,
Update,
}
impl From<MsgAction> for Action {
fn from(value: MsgAction) -> Self {
match value {
MsgAction::Addition(_) => Action::Addition,
MsgAction::Create(_) => Action::Create,
MsgAction::Delete(_) => Action::Delete,
MsgAction::Error(_) => Action::Error,
MsgAction::OnAddition(_) => Action::OnAddition,
MsgAction::OnDelete(_) => Action::OnDelete,
MsgAction::OnQuery(_) => Action::OnQuery,
MsgAction::OnUpdate(_) => Action::OnUpdate,
MsgAction::Query(_) => Action::Query,
MsgAction::Records(_) => Action::Records,
MsgAction::Register(_) => Action::Register,
MsgAction::Reply(_) => Action::Reply,
MsgAction::Show => Action::Show,
MsgAction::Update(_) => Action::Update,
}
}
}
impl From<&MsgAction> for Action {
fn from(value: &MsgAction) -> Self {
let action = value.clone();
Self::from(action)
}
}