pub struct VersionFile {
pub version: u32,
pub migrated_at: String,
}Expand description
Schema version metadata stored in <dir>/version.json.
Fields§
§version: u32Current schema version of the data in this directory.
migrated_at: StringRFC 3339 timestamp of the last migration.
Implementations§
Source§impl VersionFile
impl VersionFile
Sourcepub fn read(dir: &Path) -> Result<Option<Self>, StorageError>
pub fn read(dir: &Path) -> Result<Option<Self>, StorageError>
Read from <dir>/version.json. Returns None if the file is absent
(treated as version 0).
§Errors
Returns StorageError if the file exists but cannot be parsed.
Trait Implementations§
Source§impl Clone for VersionFile
impl Clone for VersionFile
Source§fn clone(&self) -> VersionFile
fn clone(&self) -> VersionFile
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for VersionFile
impl Debug for VersionFile
Source§impl<'de> Deserialize<'de> for VersionFile
impl<'de> Deserialize<'de> for VersionFile
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for VersionFile
impl RefUnwindSafe for VersionFile
impl Send for VersionFile
impl Sync for VersionFile
impl Unpin for VersionFile
impl UnsafeUnpin for VersionFile
impl UnwindSafe for VersionFile
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more