From b1509e9ecac1f28daefd7cb1078176d47d585252 Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Wed, 25 Feb 2026 09:50:53 +0800 Subject: Add serde derive to sheet system structs --- systems/sheet/src/sheet.rs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'systems/sheet/src/sheet.rs') 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, @@ -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, @@ -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] -- cgit