use super::*;
#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone)]
pub struct IndexFields {
pub fields: Vec<SortSpec>
}
impl IndexFields {
pub fn new(fields: Vec<SortSpec>) -> IndexFields {
IndexFields {
fields: fields
}
}
}
#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone)]
pub struct Index {
pub ddoc: Option<DocumentId>,
pub name: String,
#[serde(rename = "type")]
pub index_type: String,
pub def: IndexFields
}
#[derive(Serialize, Deserialize, Eq, PartialEq, Debug, Clone)]
pub struct IndexCreated {
pub result: Option<String>,
pub id: Option<String>,
pub name: Option<String>,
pub error: Option<String>,
pub reason: Option<String>
}
#[derive(Serialize, Deserialize, PartialEq, Debug, Clone)]
pub struct DatabaseIndexList {
pub total_rows: u32,
pub indexes: Vec<Index>
}