From 7f7e10a373b156d22dcf70daa7ab4e685eeb2560 Mon Sep 17 00:00:00 2001 From: Jeff Baskin Date: Wed, 4 Feb 2026 09:45:28 -0500 Subject: [PATCH] Created the revision stub. --- src/document/field.rs | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/document/field.rs b/src/document/field.rs index d315415..248b735 100644 --- a/src/document/field.rs +++ b/src/document/field.rs @@ -12,6 +12,7 @@ pub enum Field { Duration(Duration), Integer(i128), None, + Revision(Revision), StaticString(String), Uuid(Uuid), } @@ -116,6 +117,12 @@ impl From for Field { } } +impl From for Field { + fn from(value: Revision) -> Self { + Self::Revision(value) + } +} + impl From for Field { fn from(value: String) -> Self { Self::StaticString(value) @@ -350,6 +357,7 @@ pub enum FieldType { Duration, Integer, None, + Revision, StaticString, Uuid, } @@ -362,6 +370,7 @@ impl FieldType { FieldType::Duration => Duration::from_secs(0).into(), FieldType::Integer => 0.into(), FieldType::None => Field::None, + FieldType::Revision => Revision::new().into(), FieldType::StaticString => "".into(), FieldType::Uuid => Uuid::new_v4().into(), } @@ -376,6 +385,7 @@ impl From<&Field> for FieldType { Field::Duration(_) => Self::Duration, Field::Integer(_) => Self::Integer, Field::None => Self::None, + Field::Revision(_) => Self::Revision, Field::StaticString(_) => Self::StaticString, Field::Uuid(_) => Self::Uuid, } @@ -417,3 +427,22 @@ mod fieldtypes { } } } + +#[derive(Clone, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)] +struct Revision; + +impl Revision { + fn new() -> Self { + Self {} + } +} + +#[cfg(test)] +mod revisions { + use super::*; + + #[test] + fn can_create_empty_revision() { + let rev = Revision::new(); + } +}