Removed unneeded OnAction message action.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s
This commit is contained in:
parent
47bbf65907
commit
2495c80a33
@ -63,7 +63,6 @@ impl From<MsgAction> for Action {
|
||||
MsgAction::Create(_) => Action::Create,
|
||||
MsgAction::Delete(_) => Action::Delete,
|
||||
MsgAction::Error(_) => Action::Error,
|
||||
MsgAction::OnAction(_) => Action::OnAction,
|
||||
MsgAction::Query(_) => Action::Query,
|
||||
MsgAction::Records(_) => Action::Records,
|
||||
MsgAction::Register(_) => Action::Register,
|
||||
@ -128,7 +127,6 @@ enum MsgAction {
|
||||
// Alter
|
||||
// Remove
|
||||
Error(MTTError),
|
||||
OnAction(OnAction),
|
||||
Query(QueryType),
|
||||
Records(RecordIter),
|
||||
Register(Register),
|
||||
@ -2550,55 +2548,6 @@ mod additions {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Eq, PartialEq)]
|
||||
enum OnType {
|
||||
Query,
|
||||
Update,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct OnAction {
|
||||
on_type: OnType,
|
||||
oids: HashSet<Oid>,
|
||||
}
|
||||
|
||||
impl OnAction {
|
||||
fn new(on_type: OnType, oids: HashSet<Oid>) -> Self {
|
||||
Self {
|
||||
on_type: on_type,
|
||||
oids: oids,
|
||||
}
|
||||
}
|
||||
|
||||
fn get_type(&self) -> &OnType {
|
||||
&self.on_type
|
||||
}
|
||||
|
||||
fn get_oids(&self) -> &HashSet<Oid> {
|
||||
&self.oids
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod ons {
|
||||
use super::*;
|
||||
|
||||
#[test]
|
||||
fn can_create_on_action() {
|
||||
let count = 5;
|
||||
let values = [OnType::Query, OnType::Update];
|
||||
for on_type in values.iter() {
|
||||
let mut oids: HashSet<Oid> = HashSet::new();
|
||||
while oids.len() < count {
|
||||
oids.insert(Oid::new());
|
||||
}
|
||||
let result = OnAction::new(on_type.clone(), oids.clone());
|
||||
assert_eq!(result.get_type(), on_type);
|
||||
assert_eq!(result.get_oids(), &oids);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
enum IndexType {
|
||||
Index,
|
||||
@ -2614,16 +2563,6 @@ impl IndexType {
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct Triggers {
|
||||
/*
|
||||
* HashMap<DocumentName, HashMap<ActionType, MsgAction>>
|
||||
* document name
|
||||
* action type
|
||||
* response action
|
||||
*/
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug)]
|
||||
struct DocDef {
|
||||
doc_names: Vec<Name>,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user