pub struct CheckpointState { /* private fields */ }Expand description
Immutable, schema-pinned JSON graph state with a verified checksum.
State JSON is materialized under JsonLimits::MAXIMUM (currently 2 MiB)
and must still be validated against Self::schema by the graph schema
registry before execution. The checksum binds both schema identity and RFC
8785 state bytes.
Implementations§
Source§impl CheckpointState
impl CheckpointState
Sourcepub fn new(
schema: SchemaReference,
data: BoundedJson,
) -> Result<Self, CheckpointStateError>
pub fn new( schema: SchemaReference, data: BoundedJson, ) -> Result<Self, CheckpointStateError>
Constructs state and computes its domain-separated checksum.
§Errors
Returns CheckpointStateError::Integrity when the state cannot be
represented as RFC 8785 interoperable JSON.
Sourcepub fn restore(
schema: SchemaReference,
data: BoundedJson,
digest: Digest,
) -> Result<Self, CheckpointStateError>
pub fn restore( schema: SchemaReference, data: BoundedJson, digest: Digest, ) -> Result<Self, CheckpointStateError>
Restores state from durable columns and verifies its checksum.
§Errors
Returns CheckpointStateError when canonicalization fails or the
supplied checksum does not match the schema and state bytes.
Sourcepub const fn schema(&self) -> &SchemaReference
pub const fn schema(&self) -> &SchemaReference
Returns the exact state schema reference.
Sourcepub const fn data(&self) -> &BoundedJson
pub const fn data(&self) -> &BoundedJson
Borrows validated resource-bounded state JSON.
Trait Implementations§
Source§impl Clone for CheckpointState
impl Clone for CheckpointState
Source§impl Debug for CheckpointState
impl Debug for CheckpointState
Source§impl<'de> Deserialize<'de> for CheckpointState
impl<'de> Deserialize<'de> for CheckpointState
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
impl Eq for CheckpointState
Source§impl JsonSchema for CheckpointState
impl JsonSchema for CheckpointState
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for CheckpointState
impl PartialEq for CheckpointState
Source§impl Serialize for CheckpointState
impl Serialize for CheckpointState
impl StructuralPartialEq for CheckpointState
Auto Trait Implementations§
impl Forget for CheckpointState
impl Freeze for CheckpointState
impl Move for CheckpointState
impl RefUnwindSafe for CheckpointState
impl Send for CheckpointState
impl Sync for CheckpointState
impl Unpin for CheckpointState
impl UnsafeUnpin for CheckpointState
impl UnwindSafe for CheckpointState
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