pub struct ExecutionContext(/* private fields */);Expand description
Bounded, versioned application restart state committed with a chunk.
Implementations§
Source§impl ExecutionContext
impl ExecutionContext
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.
Trait Implementations§
Source§impl Clone for ExecutionContext
impl Clone for ExecutionContext
Source§fn clone(&self) -> ExecutionContext
fn clone(&self) -> ExecutionContext
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more