TypeDef:Uint64 was never specified in any ADR and was a partial, incomplete
addition: type_size() returned None (so is_fixed_size() was false),
OffsetMap::compute rejected it, LayoutBuilder::build would unreachable!()
panic on it, and the validator did not register a TypeDef:Uint64 keyword.
Only the SequentialReader path worked, and only because it dispatched
directly to data_access::read_u64 without consulting type_size().
Remove the variant from TypeDefKind, the read_u64/write_u64 primitives,
FieldValue::U64, the sequential-reader and engine dispatch arms, and the
associated tests. The engine now has exactly 17 first-class kinds, matching
the spec. All 286 tests pass; the workspace builds clean.
Replace all string-based TypeDef:* kind matching with a 17-variant
TypeDefKind enum. The enum provides compile-time exhaustiveness
checking, integer discriminant dispatch (jump table), and type-safe
methods (type_size, natural_alignment, is_fixed_size, etc.).
- Add TypeDefKind enum with FromStr, Display, and helper methods
- Add get_typedef_kind_enum() and get_typedef_kind_loose_enum()
- Convert DiscriminatorKind::Byte.disc_type from String to TypeDefKind
- Convert FieldPosition.kind from String to TypeDefKind
- Convert all 8 dispatch sites from string matching to enum matching
- Remove legacy string-based type_size/natural_alignment/is_fixed_size
wrapper functions — all call sites use enum methods directly
- Update tests to use enum variants
- sequential_reader.rs: change test helper write_u32/write_string param from
&mut Vec<u8> to &mut [u8] (clippy::ptr_arg)
- validation.rs: replace 3.14/2.71 with 3.5/2.5 in test instances to avoid
clippy::approx_constant (f32::consts::PI approximation)
Re-export ByteRange, OffsetMap, FieldPosition, LayoutBuilder, PackedLayout,
FieldValue, SequentialReader, and UnionDispatch at the crate root so consumers
can access the layout engine types without module-qualified paths. The
discriminator read functions (read_byte_discriminator, etc.) remain
module-qualified under alknet_typedef::tunion.
Re-export validation::build_validator at the crate root so consumers can
call alknet_typedef::build_validator(schema) directly. The data_access
functions remain module-qualified (alknet_typedef::data_access::read_u32)
since there are 28 of them and re-exporting all would be noisy.
Re-export Endian, VariableEncoding, DiscriminatorKind, and the parse_*
functions plus normalize_refs from the schema module so they're accessible
at the crate root alongside TypedefError.
Created crates/alknet-typedef/ with Cargo.toml depending on jsonschema 0.46
(default-features = false for WASM-cleanliness) and serde_json with
preserve_order. Added src/lib.rs with module declarations for all 9 modules
and skeleton source files for each. Added crate to workspace members list.
Verified: cargo check, clippy -D warnings, and build --workspace all succeed.
Dependency tree confirmed free of tokio/reqwest/rustls (WASM-clean).