moved path to router.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s

This commit is contained in:
2025-12-26 15:03:42 -05:00
parent fd9754d224
commit 7cfc982be9
4 changed files with 29 additions and 87 deletions

View File

@@ -1,7 +1,7 @@
use super::MTTError;
use crate::{
name::{Name, NameType, Names},
router::Include,
router::{Include, Path},
};
use chrono::prelude::*;
use std::{
@@ -66,48 +66,6 @@ impl From<&MsgAction> for Action {
}
}
/*
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
enum NameID {
ID(Uuid),
Name(String),
None,
}
impl NameID {
fn is_none(&self) -> bool {
match self {
Self::None => true,
_ => false,
}
}
}
impl From<&str> for NameID {
fn from(value: &str) -> Self {
Self::Name(value.to_string())
}
}
impl From<String> for NameID {
fn from(value: String) -> Self {
Self::Name(value)
}
}
impl From<Uuid> for NameID {
fn from(value: Uuid) -> Self {
Self::ID(value)
}
}
impl From<&NameID> for NameID {
fn from(value: &NameID) -> Self {
value.clone()
}
}
*/
#[derive(Clone, Debug)]
pub enum MsgAction {
Addition(Addition),
@@ -532,23 +490,6 @@ mod route_ids {
}
}
#[derive(Clone, Debug)]
pub struct Path {
pub msg_id: Include<Uuid>,
pub doc: Include<NameType>,
pub action: Include<Action>,
}
impl Path {
pub fn new(id: Include<Uuid>, doc: Include<NameType>, action: Include<Action>) -> Self {
Self {
msg_id: id,
doc: doc,
action: action,
}
}
}
#[derive(Clone, Debug)]
pub enum RegMsg {
AddRoute(Path),
@@ -744,25 +685,6 @@ mod routes {
}
}
/*
#[derive(Clone, Debug, Eq, PartialEq)]
struct RouteRequest {
msg_id: Include<Uuid>,
doc_name: Include<String>,
action: Include<Action>,
}
impl RouteRequest {
fn new(msg_id: Include<Uuid>, doc_name: Include<String>, action: Include<Action>) -> Self {
Self {
msg_id: msg_id,
doc_name: doc_name,
action: action,
}
}
}
*/
struct RouteStorage {
data: HashMap<RouteID, HashSet<Uuid>>,
}