1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
use super::schema::edits;
use serde::Serialize;

#[derive(Queryable, Clone, Debug, Serialize)]
pub struct Edit {
    pub id: u32,
    pub wiki: String,
    pub text: Vec<u8>,
    pub summary: String,
    pub baserevid: u32,
    pub pageid: u32,
    pub pagename: String,
    pub state: String,
}

#[derive(Insertable)]
#[table_name = "edits"]
pub struct NewEdit<'a> {
    pub wiki: &'a str,
    pub text: &'a [u8],
    pub summary: &'a str,
    pub baserevid: &'a u32,
    pub pageid: &'a u32,
    pub pagename: &'a str,
    pub state: &'a str,
}