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§
Sourcefn codec_version(&self) -> CodecVersion
fn codec_version(&self) -> CodecVersion
Returns the version emitted when encoding.
Sourcefn restartability(&self) -> RestartabilityDeclaration
fn restartability(&self) -> RestartabilityDeclaration
Declares whether this component can honestly claim restartability.
Provided Methods§
Sourcefn codec_upgrades(&self) -> &[CodecVersionUpgrade]
fn codec_upgrades(&self) -> &[CodecVersionUpgrade]
Declares the directed codec-version upgrades this codec can apply.
Sourcefn sensitivity(&self) -> StateSensitivity
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".