couchdb_orm/client/couchdb/responses/
all_docs.rs

1// Copyright (C) 2020-2023  OpenToolAdd
2//
3// This program is free software: you can redistribute it and/or modify
4// it under the terms of the GNU General Public License as published by
5// the Free Software Foundation, either version 3 of the License, or
6// (at your option) any later version.
7//
8// This program is distributed in the hope that it will be useful,
9// but WITHOUT ANY WARRANTY; without even the implied warranty of
10// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11// GNU General Public License for more details.
12//
13// You should have received a copy of the GNU General Public License
14// along with this program.  If not, see <http://www.gnu.org/licenses/>.
15// contact: contact@tool-add.com
16
17use serde::{Deserialize, Serialize};
18
19#[derive(Debug, Clone, Serialize, Deserialize)]
20pub struct WrapperValue {
21    pub rev: String,
22}
23
24#[derive(Debug, Clone, Serialize, Deserialize)]
25pub struct Wrapper<T: Sized> {
26    pub id: String,
27    pub key: String,
28    pub value: WrapperValue,
29    pub doc: T,
30}
31
32#[derive(Debug, Clone, Serialize, Deserialize)]
33pub struct AllDocs<T: Sized> {
34    pub total_rows: usize,
35    pub offset: usize,
36    pub rows: Vec<Wrapper<T>>,
37}