diff options
| author | troido <troido@protonmail.com> | 2020-02-17 02:24:14 +0100 |
|---|---|---|
| committer | troido <troido@protonmail.com> | 2020-02-17 02:24:14 +0100 |
| commit | c921686355c86afb5bf47e4b6c696057ede01b1f (patch) | |
| tree | cb55b0d464010e44aeeca16f0f734ac3464da600 /src/persistence.rs | |
| parent | 625ab5bb37cbe35fd9662a33bc92f73520e59c81 (diff) | |
persistently save the room state
Diffstat (limited to 'src/persistence.rs')
| -rw-r--r-- | src/persistence.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/persistence.rs b/src/persistence.rs index fc04378..1808652 100644 --- a/src/persistence.rs +++ b/src/persistence.rs @@ -28,6 +28,14 @@ pub struct FileStorage { directory: PathBuf } +impl FileStorage { + pub fn new(path: &str) -> Self { + Self { + directory: PathBuf::from(path) + } + } +} + impl PersistentStorage for FileStorage { fn load_room(&self, name: String) -> Result<SaveState> { |
