Add pagination to search results.

Move to shared definition of json requests between client/server.
This commit is contained in:
2023-03-09 18:04:55 -08:00
parent f16860dd09
commit eba362a7f2
10 changed files with 162 additions and 34 deletions

10
shared/Cargo.toml Normal file
View File

@@ -0,0 +1,10 @@
[package]
name = "shared"
version = "0.1.0"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
notmuch = { path = "../notmuch" }
serde = { version = "1.0.147", features = ["derive"] }

11
shared/src/lib.rs Normal file
View File

@@ -0,0 +1,11 @@
use notmuch::SearchSummary;
use serde::{Deserialize, Serialize};
#[derive(Serialize, Deserialize, Debug)]
pub struct SearchResult {
pub summary: SearchSummary,
pub query: String,
pub page: usize,
pub results_per_page: usize,
pub total: usize,
}