Added a table field.
Some checks failed
MoreThanText/morethantext/pipeline/head There was a failure building this commit

This commit is contained in:
2024-11-12 10:26:21 -05:00
parent 510a4fa7f8
commit 2bf495b127
3 changed files with 84 additions and 8 deletions

View File

@@ -6,11 +6,18 @@ pub enum Field {
ID(ID),
}
pub trait FieldRecord {
fn new_field() -> Field;
impl Field {
fn new(field_type: &str) -> Field {
ID::new_field()
}
}
struct Record {
pub trait FieldRecord {
fn new_field() -> Field;
fn get_type() -> String;
}
pub struct Record {
data: HashMap<String, Field>,
}
@@ -39,6 +46,19 @@ impl fmt::Display for Field {
}
}
#[cfg(test)]
mod fields {
use super::*;
#[test]
fn creaAte_new_id() {
match Field::new("id") {
Field::ID(_) => {}
_ => unreachable!("Fould should be an ID type."),
}
}
}
#[cfg(test)]
mod records {
use super::*;