implement the dump reader v6

This commit is contained in:
Tamo 2022-10-03 16:12:01 +02:00 committed by Clément Renault
parent b89ac5d7ac
commit e3bc87bf22
No known key found for this signature in database
GPG key ID: 92ADA4E935E71FA4
8 changed files with 247 additions and 69 deletions

View file

@ -1,23 +1,32 @@
use serde::{Deserialize, Serialize};
use time::OffsetDateTime;
// mod dump;
mod error;
mod reader;
mod writer;
pub use error::Error;
pub use writer::DumpWriter;
const CURRENT_DUMP_VERSION: &str = "V6";
pub struct DumpReader;
const CURRENT_DUMP_VERSION: Version = Version::V6;
type Result<T> = std::result::Result<T, Error>;
#[derive(Debug, PartialEq, Eq, Serialize, Deserialize)]
#[serde(rename_all = "camelCase")]
struct Metadata {
pub dump_version: String,
pub dump_version: Version,
pub db_version: String,
#[serde(with = "time::serde::rfc3339")]
pub dump_date: OffsetDateTime,
}
#[derive(Debug, PartialEq, Eq, Deserialize, Serialize)]
pub enum Version {
V1,
V2,
V3,
V4,
V5,
V6,
}