pub struct JournalData {
pub batch_id: String,
pub created_at: u64,
pub entries: Vec<JournalEntry>,
}Expand description
Persistent journal data describing a single match batch.
Fields§
§batch_id: StringUnique identifier for this batch of operations.
created_at: u64Creation timestamp as Unix epoch seconds.
entries: Vec<JournalEntry>Recorded operations belonging to this batch.
Implementations§
Source§impl JournalData
impl JournalData
Sourcepub async fn save(&self, path: &Path) -> Result<()>
pub async fn save(&self, path: &Path) -> Result<()>
Atomically persist this journal to path.
The data is first serialized as pretty JSON, written to a
sibling temporary file, flushed and fsynced, and finally renamed
into place. Parent directories are created on demand. All
blocking I/O is executed inside tokio::task::spawn_blocking.
Trait Implementations§
Source§impl Clone for JournalData
impl Clone for JournalData
Source§fn clone(&self) -> JournalData
fn clone(&self) -> JournalData
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 JournalData
impl Debug for JournalData
Source§impl<'de> Deserialize<'de> for JournalData
impl<'de> Deserialize<'de> for JournalData
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
Source§impl PartialEq for JournalData
impl PartialEq for JournalData
Source§impl Serialize for JournalData
impl Serialize for JournalData
impl Eq for JournalData
impl StructuralPartialEq for JournalData
Auto Trait Implementations§
impl Freeze for JournalData
impl RefUnwindSafe for JournalData
impl Send for JournalData
impl Sync for JournalData
impl Unpin for JournalData
impl UnsafeUnpin for JournalData
impl UnwindSafe for JournalData
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.