Moved Oid into document module.
Some checks failed
Gitea Actions Demo / Explore-Gitea-Actions (push) Failing after 1s

This commit is contained in:
2026-02-13 12:48:17 -05:00
parent 45bcd04ee3
commit 115910120c
4 changed files with 32 additions and 51 deletions

View File

@@ -1,12 +1,40 @@
use crate::{
action::Field,
message::wrapper::Oid,
mtterror::{ErrorID, MTTError},
name::{Name, NameType, Names},
};
use std::collections::HashMap;
use uuid::Uuid;
#[derive(Clone, Debug, Eq, Hash, PartialEq)]
pub struct Oid {
oid: Uuid,
}
impl Oid {
pub fn new() -> Self {
Self {
oid: Uuid::new_v4(),
}
}
}
#[cfg(test)]
mod oids {
use super::*;
#[test]
fn are_oids_random() {
let count = 10;
let mut holder: Vec<Oid> = Vec::new();
while holder.len() < count {
let result = Oid::new();
assert!(!holder.contains(&result));
holder.push(result);
}
}
}
#[derive(Clone, Debug)]
pub struct InternalRecord {
data: HashMap<Uuid, Field>,