Add pagination to search results.
Move to shared definition of json requests between client/server.
This commit is contained in:
10
shared/Cargo.toml
Normal file
10
shared/Cargo.toml
Normal 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
11
shared/src/lib.rs
Normal 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,
|
||||
}
|
||||
Reference in New Issue
Block a user