derive serde for method and format

This is nicer when working with UpdateMeta struct
This commit is contained in:
mpostma 2020-12-22 18:17:35 +01:00
parent 91d8198d17
commit d487791b03
No known key found for this signature in database
GPG Key ID: CBC8A7C1D7A28C3A

View File

@ -181,7 +181,7 @@ pub fn write_into_lmdb_database(
Ok(()) Ok(())
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive] #[non_exhaustive]
pub enum IndexDocumentsMethod { pub enum IndexDocumentsMethod {
/// Replace the previous document with the new one, /// Replace the previous document with the new one,
@ -193,7 +193,7 @@ pub enum IndexDocumentsMethod {
UpdateDocuments, UpdateDocuments,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)] #[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
#[non_exhaustive] #[non_exhaustive]
pub enum UpdateFormat { pub enum UpdateFormat {
/// The given update is a real **comma seperated** CSV with headers on the first line. /// The given update is a real **comma seperated** CSV with headers on the first line.