pub enum VersionedStreamSpec {
V1(SerializableStreamSpec),
}Expand description
Versioned wrapper for SerializableStreamSpec.
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_stream_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 VersionedStreamSpec
impl VersionedStreamSpec
Sourcepub fn into_latest(self) -> SerializableStreamSpec
pub fn into_latest(self) -> SerializableStreamSpec
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_stream_spec
instead, which properly sets ast_version to CURRENT_AST_VERSION.
Trait Implementations§
Source§impl Clone for VersionedStreamSpec
impl Clone for VersionedStreamSpec
Source§fn clone(&self) -> VersionedStreamSpec
fn clone(&self) -> VersionedStreamSpec
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more