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::Create(_) => Action::Create,
|
||||||
MsgAction::Delete(_) => Action::Delete,
|
MsgAction::Delete(_) => Action::Delete,
|
||||||
MsgAction::Error(_) => Action::Error,
|
MsgAction::Error(_) => Action::Error,
|
||||||
MsgAction::OnAction(_) => Action::OnAction,
|
|
||||||
MsgAction::Query(_) => Action::Query,
|
MsgAction::Query(_) => Action::Query,
|
||||||
MsgAction::Records(_) => Action::Records,
|
MsgAction::Records(_) => Action::Records,
|
||||||
MsgAction::Register(_) => Action::Register,
|
MsgAction::Register(_) => Action::Register,
|
||||||
@ -128,7 +127,6 @@ enum MsgAction {
|
|||||||
// Alter
|
// Alter
|
||||||
// Remove
|
// Remove
|
||||||
Error(MTTError),
|
Error(MTTError),
|
||||||
OnAction(OnAction),
|
|
||||||
Query(QueryType),
|
Query(QueryType),
|
||||||
Records(RecordIter),
|
Records(RecordIter),
|
||||||
Register(Register),
|
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)]
|
#[derive(Clone, Debug)]
|
||||||
enum IndexType {
|
enum IndexType {
|
||||||
Index,
|
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)]
|
#[derive(Clone, Debug)]
|
||||||
struct DocDef {
|
struct DocDef {
|
||||||
doc_names: Vec<Name>,
|
doc_names: Vec<Name>,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user