pub struct CheckpointHeader {
pub version: [u32; 3],
pub timestamp: u64,
pub step: u64,
pub crate_name: String,
pub checksum: u32,
}Expand description
Header record written at the top of every checkpoint file.
Fields§
§version: [u32; 3]File format version [major, minor, patch].
timestamp: u64Unix timestamp (seconds) of when the checkpoint was written.
step: u64Simulation step number.
crate_name: StringProducing crate name.
checksum: u32CRC32 checksum of the payload that follows.
Implementations§
Source§impl CheckpointHeader
impl CheckpointHeader
Sourcepub fn new(
version: [u32; 3],
timestamp: u64,
step: u64,
crate_name: impl Into<String>,
checksum: u32,
) -> Self
pub fn new( version: [u32; 3], timestamp: u64, step: u64, crate_name: impl Into<String>, checksum: u32, ) -> Self
Create a new CheckpointHeader.
Sourcepub fn from_bytes(data: &[u8]) -> Result<Self>
pub fn from_bytes(data: &[u8]) -> Result<Self>
Deserialise from bytes.
Sourcepub fn version_compatible(&self, expected_major: u32) -> bool
pub fn version_compatible(&self, expected_major: u32) -> bool
Return true if this header’s major version matches expected.
Trait Implementations§
Source§impl Clone for CheckpointHeader
impl Clone for CheckpointHeader
Source§fn clone(&self) -> CheckpointHeader
fn clone(&self) -> CheckpointHeader
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 CheckpointHeader
impl Debug for CheckpointHeader
Source§impl PartialEq for CheckpointHeader
impl PartialEq for CheckpointHeader
impl StructuralPartialEq for CheckpointHeader
Auto Trait Implementations§
impl Freeze for CheckpointHeader
impl RefUnwindSafe for CheckpointHeader
impl Send for CheckpointHeader
impl Sync for CheckpointHeader
impl Unpin for CheckpointHeader
impl UnsafeUnpin for CheckpointHeader
impl UnwindSafe for CheckpointHeader
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<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.