pub struct RecordHeader {
pub offset: Offset,
pub prev_hash: Hash,
pub timestamp: Timestamp,
pub payload_len: u32,
pub record_kind: RecordKind,
}Expand description
Metadata header for every log record.
This structure contains all metadata needed to verify and process a log record without reading its payload.
Fields§
§offset: OffsetPosition in the log (0-indexed).
prev_hash: HashSHA-256 link to the previous record’s hash (genesis for first record).
timestamp: TimestampWhen the record was committed (monotonic wall-clock).
payload_len: u32Size of the payload in bytes.
record_kind: RecordKindType of record (Data, Checkpoint, Tombstone).
Implementations§
Source§impl RecordHeader
impl RecordHeader
Sourcepub fn new(
offset: Offset,
prev_hash: Hash,
timestamp: Timestamp,
payload_len: u32,
record_kind: RecordKind,
) -> Self
pub fn new( offset: Offset, prev_hash: Hash, timestamp: Timestamp, payload_len: u32, record_kind: RecordKind, ) -> Self
Creates a new record header.
§Arguments
offset- Position in the logprev_hash- Hash of the previous record (or GENESIS for first)timestamp- When this record was committedpayload_len- Size of the payload in bytesrecord_kind- Type of record
Sourcepub fn is_genesis(&self) -> bool
pub fn is_genesis(&self) -> bool
Returns true if this is the first record in the log.
Trait Implementations§
Source§impl Clone for RecordHeader
impl Clone for RecordHeader
Source§fn clone(&self) -> RecordHeader
fn clone(&self) -> RecordHeader
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 RecordHeader
impl Debug for RecordHeader
Source§impl<'de> Deserialize<'de> for RecordHeader
impl<'de> Deserialize<'de> for RecordHeader
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 Hash for RecordHeader
impl Hash for RecordHeader
Source§impl PartialEq for RecordHeader
impl PartialEq for RecordHeader
Source§impl Serialize for RecordHeader
impl Serialize for RecordHeader
impl Copy for RecordHeader
impl Eq for RecordHeader
impl StructuralPartialEq for RecordHeader
Auto Trait Implementations§
impl Freeze for RecordHeader
impl RefUnwindSafe for RecordHeader
impl Send for RecordHeader
impl Sync for RecordHeader
impl Unpin for RecordHeader
impl UnwindSafe for RecordHeader
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