pub struct Journal {
pub version: u32,
pub status: JournalStatus,
pub created_at: String,
pub backup_enabled: bool,
pub entries: Vec<JournalEntry>,
}Expand description
The write-ahead journal persisted to disk.
Fields§
§version: u32Schema version for forward compatibility.
status: JournalStatusCurrent status of the atomic operation.
created_at: StringISO 8601 timestamp of journal creation.
backup_enabled: boolWhether backups were enabled for this operation.
entries: Vec<JournalEntry>Per-file entries tracking the state of each staged write.
Implementations§
Source§impl Journal
impl Journal
Sourcepub fn new(entries: Vec<JournalEntry>, backup_enabled: bool) -> Self
pub fn new(entries: Vec<JournalEntry>, backup_enabled: bool) -> Self
Create a new journal in Staged state.
Sourcepub fn transition_to_committing(&mut self)
pub fn transition_to_committing(&mut self)
Transition the journal to Committing state.
Sourcepub fn mark_entry_completed(&mut self, index: usize)
pub fn mark_entry_completed(&mut self, index: usize)
Mark a specific entry as rename-completed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Journal
impl<'de> Deserialize<'de> for Journal
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 Journal
impl RefUnwindSafe for Journal
impl Send for Journal
impl Sync for Journal
impl Unpin for Journal
impl UnsafeUnpin for Journal
impl UnwindSafe for Journal
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