pub struct MarkerSegmentHeader {
pub segment_id: u64,
pub start_commit_seq: u64,
}Expand description
On-disk segment header for the commit marker stream.
Layout (36 bytes, all LE):
magic : [u8; 4] — "FSMK"
version : u32 — 1
segment_id : u64 — monotonic identifier
start_commit_seq: u64 — first commit_seq in this segment
record_size : u32 — bytes per record (88 in V1)
header_xxh3 : u64 — xxhash3 of all preceding fieldsFields§
§segment_id: u64Monotonic segment identifier (matches filename).
start_commit_seq: u64First commit_seq stored in this segment.
Implementations§
Source§impl MarkerSegmentHeader
impl MarkerSegmentHeader
Sourcepub const fn new(segment_id: u64, start_commit_seq: u64) -> Self
pub const fn new(segment_id: u64, start_commit_seq: u64) -> Self
Create a new header for the given segment.
Sourcepub fn encode(&self) -> [u8; 36]
pub fn encode(&self) -> [u8; 36]
Encode to exactly MARKER_SEGMENT_HEADER_BYTES bytes.
Sourcepub fn decode(data: &[u8]) -> Result<Self, MarkerError>
pub fn decode(data: &[u8]) -> Result<Self, MarkerError>
Decode from a byte slice. Validates magic, version, record_size, and checksum.
Trait Implementations§
Source§impl Clone for MarkerSegmentHeader
impl Clone for MarkerSegmentHeader
Source§fn clone(&self) -> MarkerSegmentHeader
fn clone(&self) -> MarkerSegmentHeader
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 MarkerSegmentHeader
impl Debug for MarkerSegmentHeader
Source§impl PartialEq for MarkerSegmentHeader
impl PartialEq for MarkerSegmentHeader
impl Copy for MarkerSegmentHeader
impl Eq for MarkerSegmentHeader
impl StructuralPartialEq for MarkerSegmentHeader
Auto Trait Implementations§
impl Freeze for MarkerSegmentHeader
impl RefUnwindSafe for MarkerSegmentHeader
impl Send for MarkerSegmentHeader
impl Sync for MarkerSegmentHeader
impl Unpin for MarkerSegmentHeader
impl UnsafeUnpin for MarkerSegmentHeader
impl UnwindSafe for MarkerSegmentHeader
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, _span: NoopSpan) -> Self
fn instrument(self, _span: NoopSpan) -> Self
Instruments this future with a span (no-op when disabled).
Source§fn in_current_span(self) -> Self
fn in_current_span(self) -> Self
Instruments this future with the current span (no-op when disabled).