Moved action type into action module.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s
This commit is contained in:
@@ -1,54 +0,0 @@
|
||||
use crate::{
|
||||
action::{MsgAction, Query},
|
||||
document::definition::DocDef,
|
||||
message::wrapper::{Addition, Delete, Records, Reply, Update},
|
||||
mtterror::MTTError,
|
||||
queue::data_director::Register,
|
||||
UserAction,
|
||||
};
|
||||
|
||||
#[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)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user