55 lines
1.4 KiB
Rust
Raw Normal View History

use crate::{
2026-02-07 22:03:00 -05:00
action::{MsgAction, Query},
document::definition::DocDef,
2026-02-06 12:06:51 -05:00
message::wrapper::{Addition, Delete, Records, Reply, Update},
mtterror::MTTError,
queue::data_director::Register,
2026-02-06 12:06:51 -05:00
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)
}
}