pub struct DerivedCheckpoint { /* private fields */ }Expand description
Versioned, payload-free durable metadata for one derived engine.
Implementations§
Source§impl DerivedCheckpoint
impl DerivedCheckpoint
Sourcepub const fn new(engine: DerivedEngine, cursor: DerivedCursor) -> Self
pub const fn new(engine: DerivedEngine, cursor: DerivedCursor) -> Self
Creates the current checkpoint version for one engine.
Sourcepub const fn upgrade_legacy(
engine: DerivedEngine,
source_epoch: u64,
legacy: LegacyDerivedCursorV0,
) -> Self
pub const fn upgrade_legacy( engine: DerivedEngine, source_epoch: u64, legacy: LegacyDerivedCursorV0, ) -> Self
Upgrades a proven version-zero offset into the current epoch-aware contract.
Sourcepub const fn format_version(self) -> u16
pub const fn format_version(self) -> u16
Returns the durable format version emitted by Self::encode.
Sourcepub const fn engine(self) -> DerivedEngine
pub const fn engine(self) -> DerivedEngine
Returns the sole engine allowed to own this metadata.
Sourcepub const fn cursor(self) -> DerivedCursor
pub const fn cursor(self) -> DerivedCursor
Returns the durable cursor contained in this checkpoint.
Sourcepub fn encode(self) -> [u8; 32]
pub fn encode(self) -> [u8; 32]
Encodes the fixed-size version-one checkpoint.
The format contains magic, version, engine, source epoch, exclusive offset, and CRC32. It intentionally contains no message payload, topic, queue, or second WAL record.
Sourcepub fn decode(
encoded: &[u8],
expected_engine: DerivedEngine,
) -> Result<Self, StoreContractViolation>
pub fn decode( encoded: &[u8], expected_engine: DerivedEngine, ) -> Result<Self, StoreContractViolation>
Decodes and validates one fixed-size checkpoint for expected_engine.
§Errors
Returns StoreContractViolation for a malformed, corrupted, unsupported, or
cross-engine checkpoint. Callers must fail readiness rather than guessing a cursor.