summaryrefslogtreecommitdiff
path: root/systems/sheet/src/sheet.rs
diff options
context:
space:
mode:
author魏曹先生 <1992414357@qq.com>2026-02-25 09:50:53 +0800
committer魏曹先生 <1992414357@qq.com>2026-02-25 09:50:53 +0800
commitb1509e9ecac1f28daefd7cb1078176d47d585252 (patch)
tree38398a783e79a1351cc06acadea2de64dfd969a5 /systems/sheet/src/sheet.rs
parentce7222fbde5b260508e350afd5f17b5e635ede76 (diff)
Add serde derive to sheet system structs
Diffstat (limited to 'systems/sheet/src/sheet.rs')
-rw-r--r--systems/sheet/src/sheet.rs9
1 files changed, 5 insertions, 4 deletions
diff --git a/systems/sheet/src/sheet.rs b/systems/sheet/src/sheet.rs
index e0275cb..e169e4e 100644
--- a/systems/sheet/src/sheet.rs
+++ b/systems/sheet/src/sheet.rs
@@ -6,6 +6,7 @@ use std::{
};
use memmap2::Mmap;
+use serde::{Deserialize, Serialize};
use tokio::fs;
use crate::{
@@ -25,7 +26,7 @@ pub mod writer;
// Format
pub mod v1;
-#[derive(Default, Debug, Clone, PartialEq)]
+#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct Sheet {
/// Sheet Name
name: String,
@@ -40,7 +41,7 @@ pub struct Sheet {
/// Full Sheet information
///
/// Used to wrap as a Sheet object for editing and persistence
-#[derive(Default, Debug, Clone, PartialEq, Eq)]
+#[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub struct SheetData {
/// All local mappings
mappings: HashSet<LocalMapping>,
@@ -55,7 +56,7 @@ pub struct SheetDataMmap {
///
/// Stored in the Sheet, records the editing operations that **will** be performed on its SheetData
/// The content will be cleared after the edits are applied
-#[derive(Default, Debug, Clone, PartialEq)]
+#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct SheetEdit {
/// Edit history
list: Vec<SheetEditItem>,
@@ -76,7 +77,7 @@ impl SheetEdit {
}
}
-#[derive(Default, Debug, Clone, PartialEq)]
+#[derive(Default, Debug, Clone, PartialEq, Serialize, Deserialize)]
pub enum SheetEditItem {
/// Do nothing, this entry is not included in checksum and audit
#[default]