tinysearch 0.10.0

A tiny search engine for static websites
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use serde::{Deserialize, Serialize};
use std::collections::HashMap;

#[derive(Debug, Serialize, Deserialize)]
pub struct Post {
    #[serde(flatten)]
    pub fields: HashMap<String, serde_json::Value>,
}

pub type Posts = Vec<Post>;

pub fn read(raw: String) -> Result<Posts, serde_json::Error> {
    serde_json::from_str(&raw)
}