summaryrefslogtreecommitdiff
path: root/src/fsentry.rs
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2020-12-11 17:41:42 +0200
committerLars Wirzenius <liw@liw.fi>2020-12-11 18:12:46 +0200
commit4d810f49298cce32ee0165b144af1917588c2de7 (patch)
treea1b51a323f89a80eeded6032f906fce1bb197bf6 /src/fsentry.rs
parentc2df16bb3644fc270a3f5ce7e048d509de0e4b51 (diff)
downloadobnam2-4d810f49298cce32ee0165b144af1917588c2de7.tar.gz
feat! store file metadata as JSON
This avoids having to add extra columns when we add more metadata support. This may be worth re-thinking later, once things stabilize.
Diffstat (limited to 'src/fsentry.rs')
-rw-r--r--src/fsentry.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/fsentry.rs b/src/fsentry.rs
index 97274ed..ca73ef6 100644
--- a/src/fsentry.rs
+++ b/src/fsentry.rs
@@ -1,3 +1,4 @@
+use serde::{Deserialize, Serialize};
use std::path::{Path, PathBuf};
/// A file system entry.
@@ -9,7 +10,7 @@ use std::path::{Path, PathBuf};
///
/// This is everything Obnam cares about each file system object, when
/// making a backup.
-#[derive(Debug)]
+#[derive(Debug, Serialize, Deserialize)]
pub struct FilesystemEntry {
kind: FilesystemKind,
path: PathBuf,
@@ -54,7 +55,7 @@ impl FilesystemEntry {
}
/// Different types of file system entries.
-#[derive(Debug, Copy, Clone, PartialEq)]
+#[derive(Debug, Copy, Clone, PartialEq, Serialize, Deserialize)]
pub enum FilesystemKind {
Regular,
Directory,