pub enum VersionedStackSpec {
V1(SerializableStackSpec),
}Expand description
Versioned wrapper for SerializableStackSpec.
This enum allows deserializing multiple AST versions and then
converting them to the latest format via into_latest().
⚠️ IMPORTANT: This enum requires the ast_version field to be present in JSON.
It does NOT handle version-less (legacy) JSON files. For loading real-world ASTs
that may lack the ast_version field, use load_stack_spec() instead.
Note: Only Deserialize is derived to avoid duplicate ast_version keys
(the inner struct already has this field, and we only use this for loading).
Variants§
Implementations§
Source§impl VersionedStackSpec
impl VersionedStackSpec
Sourcepub fn into_latest(self) -> SerializableStackSpec
pub fn into_latest(self) -> SerializableStackSpec
Convert the versioned spec to the latest format.
⚠️ WARNING: This returns the spec with its original ast_version field unchanged.
If you need round-trip safety (e.g., serialize then deserialize), use load_stack_spec
instead, which properly sets ast_version to CURRENT_AST_VERSION.
Trait Implementations§
Source§impl Clone for VersionedStackSpec
impl Clone for VersionedStackSpec
Source§fn clone(&self) -> VersionedStackSpec
fn clone(&self) -> VersionedStackSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more