From d3fb69cf129fe70c932a5d82fdd1bcc613544b5b Mon Sep 17 00:00:00 2001 From: Joris Date: Sun, 27 Nov 2022 15:38:39 +0100 Subject: Speed up deck synchronization Apply changes for what has been inserted, updated, removed. Also use transactions to speed up multi-writing. --- src/model/mod.rs | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'src/model/mod.rs') diff --git a/src/model/mod.rs b/src/model/mod.rs index 185f401..2dc1ab5 100644 --- a/src/model/mod.rs +++ b/src/model/mod.rs @@ -1,3 +1,29 @@ -pub mod card; +use crate::space_repetition; + pub mod difficulty; -pub mod entry; + +#[derive(Debug, Clone)] +pub struct Line { + pub part_1: Vec, + pub part_2: Vec, +} + +pub struct DbEntry { + pub question: String, + pub responses: Vec, + pub deleted: Option, +} + +#[derive(Debug)] +pub struct Card { + pub question: String, + pub responses: Vec, + pub state: space_repetition::State, + pub ready: u64, +} + +#[derive(Debug, Clone, PartialEq, Eq, Hash)] +pub struct Question { + pub question: String, + pub responses: Vec, +} -- cgit v1.2.3