Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 2s
55 lines
1.4 KiB
Rust
55 lines
1.4 KiB
Rust
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)
|
|
}
|
|
}
|