pub struct StateJournal {
pub handoff_id: HandoffId,
pub phase: Phase,
pub incumbent_pid: u32,
pub successor_pid: Option<u32>,
pub started_at_unix_ms: u64,
}Fields§
§handoff_id: HandoffId§phase: Phase§incumbent_pid: u32§successor_pid: Option<u32>§started_at_unix_ms: u64Unix millis when the handoff was initiated.
Implementations§
Source§impl StateJournal
impl StateJournal
Sourcepub fn write_atomic(&self, path: &Path) -> Result<()>
pub fn write_atomic(&self, path: &Path) -> Result<()>
Atomically write the journal. Creates the parent directory if missing.
Writes the payload to <path>.tmp, fsyncs it, renames, then fsyncs
the parent directory. The file fsync makes the contents durable;
the directory fsync makes the rename’s link-update durable. Without
the directory fsync the rename can be lost on power failure even
though the file contents survived — leaving a journaled phase that
silently rolls back to the prior entry on supervisor restart. Pairs
with the same pattern in lock.rs::write_pid_atomic.
Trait Implementations§
Source§impl Clone for StateJournal
impl Clone for StateJournal
Source§fn clone(&self) -> StateJournal
fn clone(&self) -> StateJournal
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 StateJournal
impl Debug for StateJournal
Source§impl<'de> Deserialize<'de> for StateJournal
impl<'de> Deserialize<'de> for StateJournal
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 StateJournal
impl RefUnwindSafe for StateJournal
impl Send for StateJournal
impl Sync for StateJournal
impl Unpin for StateJournal
impl UnsafeUnpin for StateJournal
impl UnwindSafe for StateJournal
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