Skip to main content

Crate type_history_core

Crate type_history_core 

Source
Expand description

Read stored versions and describe the schemas checked by Type History.

Versioned keeps a record’s stable name, version, and data together. Generated code selects the stored type when deserializing it, then applies adjacent conversions when the application requests the current type. decode handles JSON payloads whose metadata is stored separately.

The resolved module describes serialized field shapes so builds can compare them with frozen schemas. Most applications use these APIs through the type-history crate, which also re-exports the declaration macros. Framework and macro authors can use this crate as the runtime for their generated code.

Re-exports§

pub use resolved::ConstantMembership;
pub use resolved::ConstantShape;
pub use resolved::FieldSchema;
pub use resolved::JsonSchemaField;
pub use resolved::ProfileError;
pub use resolved::ResolvedSchema;
pub use resolved::SchemaShape;
pub use resolved::SetMembership;
pub use resolved::WireNode;

Modules§

adapters
Checked field adapters with stable storage contracts.
canonical_json
Dependency-neutral canonical JSON byte encoding shared by history internals.
resolved
Rustc-resolved structural wire schemas used by generated histories and their frontends.

Structs§

DecodeContext
Immutable original and adjacent version context for a decoding failure.
DecodeError
Decoding failure with original and adjacent version context.
History
Exact-version decoder followed by adjacent typed conversions.
InvalidPayloadVersion
Error returned when a raw payload schema version is zero.
PayloadVersion
Positive schema version of one durable record.
StableName
Validated stable name shared by every version of a type.
Versioned
A serializable value that keeps its stable name, version, and data together.

Enums§

DecodeFailureKind
Stable classification of historical decoding failures.
InvalidStableName
Invalid stable name for a type and its history.
ReadError
A stored stable name mismatch or an exact-version decoding failure.

Traits§

HasHistory
Current record with a generated exact-version history.

Functions§

decode
Read a JSON payload whose stable name and version are stored separately.