pub struct Document {
pub id: String,
pub form_id: String,
pub workflow_id: String,
pub current_phase: String,
pub data: HashMap<String, Value>,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
}Expand description
Represents a single instance of a Form.
While FormDefinition defines the structure, Document holds the actual data.
The data field is a dynamic map where keys correspond to FieldDefinition.id.
Fields§
§id: StringUnique identifier for this specific document (usually a UUID).
form_id: StringLinks this document to a specific Form Definition.
workflow_id: StringLinks this document to a specific Workflow Definition
current_phase: StringLinks this document to a specific Phase
data: HashMap<String, Value>The generic data payload. Key: Field ID (e.g., “incident_date”) Value: The user input (String, Number, Boolean, etc.)
Note: We do NOT validate the content of these values here.
That requires the FormDefinition and happens in the molten-document crate.
created_at: DateTime<Utc>Metadata: When this document was created.
updated_at: DateTime<Utc>Metadata: When this document was last modified.
Implementations§
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Document
impl<'de> Deserialize<'de> for Document
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'v_a> ValidateArgs<'v_a> for Document
impl<'v_a> ValidateArgs<'v_a> for Document
Auto Trait Implementations§
impl Freeze for Document
impl RefUnwindSafe for Document
impl Send for Document
impl Sync for Document
impl Unpin for Document
impl UnwindSafe for Document
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more