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<ExecutionContext, StateError>
pub fn encode<T>( value: &T, codec: &(impl VersionedStateCodec<T> + ?Sized), limits: StateLimits, ) -> Result<ExecutionContext, 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<ExecutionContext, StateError>
pub fn from_json( bytes: &[u8], limits: StateLimits, ) -> Result<ExecutionContext, 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 moreSource§impl Debug for ExecutionContext
impl Debug for ExecutionContext
impl Eq for ExecutionContext
Source§impl PartialEq for ExecutionContext
impl PartialEq for ExecutionContext
impl StructuralPartialEq for ExecutionContext
Auto Trait Implementations§
impl Freeze for ExecutionContext
impl RefUnwindSafe for ExecutionContext
impl Send for ExecutionContext
impl Sync for ExecutionContext
impl Unpin for ExecutionContext
impl UnsafeUnpin for ExecutionContext
impl UnwindSafe for ExecutionContext
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