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<Checkpoint, StateError>
pub fn encode<T>( value: &T, codec: &(impl VersionedStateCodec<T> + ?Sized), limits: StateLimits, ) -> Result<Checkpoint, 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<Checkpoint, StateError>
pub fn from_json( bytes: &[u8], limits: StateLimits, ) -> Result<Checkpoint, 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 moreSource§impl Debug for Checkpoint
impl Debug for Checkpoint
impl Eq for Checkpoint
Source§impl PartialEq for Checkpoint
impl PartialEq for Checkpoint
impl StructuralPartialEq for Checkpoint
Auto Trait Implementations§
impl Freeze for Checkpoint
impl RefUnwindSafe for Checkpoint
impl Send for Checkpoint
impl Sync for Checkpoint
impl Unpin for Checkpoint
impl UnsafeUnpin for Checkpoint
impl UnwindSafe for Checkpoint
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
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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more