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 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) } }