pub struct Checkpoint(/* private fields */);Expand description
A bounded, versioned reader position committed with a chunk.
Implementations§
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn encode<T>(
value: &T,
codec: &(impl VersionedStateCodec<T> + ?Sized),
limits: StateLimits,
) -> Result<Self, StateError>
pub fn encode<T>( value: &T, codec: &(impl VersionedStateCodec<T> + ?Sized), limits: StateLimits, ) -> Result<Self, StateError>
Encodes a current typed value with explicit resource limits.
§Errors
Returns a redacted codec, schema, JSON-shape, size, or depth failure.
Sourcepub fn from_json(bytes: &[u8], limits: StateLimits) -> Result<Self, StateError>
pub fn from_json(bytes: &[u8], limits: StateLimits) -> Result<Self, StateError>
Validates a serialized framework envelope before retaining it.
§Errors
Returns a redacted format, schema, shape, size, or depth failure.
Sourcepub fn decode<T>(
&self,
codec: &(impl VersionedStateCodec<T> + ?Sized),
) -> Result<T, StateError>
pub fn decode<T>( &self, codec: &(impl VersionedStateCodec<T> + ?Sized), ) -> Result<T, StateError>
Decodes or upgrades the retained payload through codec.
§Errors
Returns a redacted schema-compatibility or codec failure.
Sourcepub const fn format_version(&self) -> u16
pub const fn format_version(&self) -> u16
Returns the framework envelope format version.
Sourcepub const fn schema_id(&self) -> &StateSchemaId
pub const fn schema_id(&self) -> &StateSchemaId
Borrows the validated application schema identifier.
Sourcepub const fn schema_version(&self) -> StateSchemaVersion
pub const fn schema_version(&self) -> StateSchemaVersion
Returns the retained application schema version.
Sourcepub const fn encoded_len(&self) -> usize
pub const fn encoded_len(&self) -> usize
Returns the validated serialized-envelope byte size.
Sourcepub fn to_json(&self) -> Result<Vec<u8>, StateError>
pub fn to_json(&self) -> Result<Vec<u8>, StateError>
Serializes the complete framework envelope.
§Errors
Returns a redacted format failure if the retained JSON value cannot be serialized.
Sourcepub fn payload_json(&self) -> Result<Vec<u8>, StateError>
pub fn payload_json(&self) -> Result<Vec<u8>, StateError>
Serializes only the application payload for an authorized persistence adapter.
This value can contain sensitive restart data and must not be logged or exported as telemetry.
§Errors
Returns a redacted format failure if the retained JSON value cannot be serialized.
Source§impl Checkpoint
impl Checkpoint
Sourcepub fn generation_digest(&self) -> [u8; 32]
pub fn generation_digest(&self) -> [u8; 32]
Returns the framework digest identifying this checkpoint generation.
Retry keys are derived from the generation, so the runtime and every durable adapter must agree on this exact derivation.
Trait Implementations§
Source§impl Clone for Checkpoint
impl Clone for Checkpoint
Source§fn clone(&self) -> Checkpoint
fn clone(&self) -> Checkpoint
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more