Skip to main content

ComponentStateCodec

Trait ComponentStateCodec 

Source
pub trait ComponentStateCodec<T>: VersionedStateCodec<T> {
    // Required methods
    fn codec_id(&self) -> &CodecId;
    fn codec_version(&self) -> CodecVersion;
    fn restartability(&self) -> RestartabilityDeclaration;

    // Provided methods
    fn codec_upgrades(&self) -> &[CodecVersionUpgrade] { ... }
    fn sensitivity(&self) -> StateSensitivity { ... }
}
Expand description

A component-state codec: the application-schema axis (via the VersionedStateCodec supertrait) plus the codec identity/version axis, sensitivity classification, and restartability declaration.

Any existing VersionedStateCodec implementation becomes a ComponentStateCodec unchanged by wrapping it in DefaultComponentCodec – this trait is additive, not a replacement.

Required Methods§

Source

fn codec_id(&self) -> &CodecId

Returns the stable codec identifier.

Source

fn codec_version(&self) -> CodecVersion

Returns the version emitted when encoding.

Source

fn restartability(&self) -> RestartabilityDeclaration

Declares whether this component can honestly claim restartability.

Provided Methods§

Source

fn codec_upgrades(&self) -> &[CodecVersionUpgrade]

Declares the directed codec-version upgrades this codec can apply.

Source

fn sensitivity(&self) -> StateSensitivity

Declares this component’s state sensitivity.

Defaults to StateSensitivity::Sensitive (fail-safe).

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§