API shims: Types and StructuredData assemblies #5

Closed
opened 2026-08-08 08:11:52 +00:00 by hugo · 1 comment
Owner

Objective

Implement every callable public signature from LibreMetaverse.Types and LibreMetaverse.StructuredData with final Rust-facing types and standardized failing bodies.

Deliverables

  • Cover UUID, math types, enums, collection/cache types, OSD values and containers, and every serializer/parser entry point.
  • Translate constructors, fields, constants, operators, conversions, generics, and interfaces without erasing types.
  • Record every mapping decision and source documentation ID.
  • Keep serialization behavior unimplemented except real constants and layouts.

Validation

  • Reach 100% catalog coverage for both assemblies.
  • cargo check -p libremetaverse-types -p libremetaverse-structured-data --all-targets.
  • cargo doc resolves all public signatures without broken links or inaccessible types.

Prerequisite

Stage 0 project setup is complete. Do not implement production behavior in this milestone.

Project constraints

  • Implement the public surface in native Rust only; no CLR hosting, FFI bridge, subprocess, RPC, or C# fallback.
  • Preserve recognizable API concepts while applying the documented Rust mapping rules.
  • Do not weaken parity requirements or add functional behavior outside this issue.
  • Update the API mapping, coverage report, public docs, and relevant handover status in the same change.
## Objective Implement every callable public signature from LibreMetaverse.Types and LibreMetaverse.StructuredData with final Rust-facing types and standardized failing bodies. ## Deliverables - Cover UUID, math types, enums, collection/cache types, OSD values and containers, and every serializer/parser entry point. - Translate constructors, fields, constants, operators, conversions, generics, and interfaces without erasing types. - Record every mapping decision and source documentation ID. - Keep serialization behavior unimplemented except real constants and layouts. ## Validation - Reach 100% catalog coverage for both assemblies. - `cargo check -p libremetaverse-types -p libremetaverse-structured-data --all-targets`. - `cargo doc` resolves all public signatures without broken links or inaccessible types. ## Prerequisite Stage 0 project setup is complete. Do not implement production behavior in this milestone. ## Project constraints - Implement the public surface in native Rust only; no CLR hosting, FFI bridge, subprocess, RPC, or C# fallback. - Preserve recognizable API concepts while applying the documented Rust mapping rules. - Do not weaken parity requirements or add functional behavior outside this issue. - Update the API mapping, coverage report, public docs, and relevant handover status in the same change.
hugo added this to the 02 - Full public API signature shim milestone 2026-08-08 08:11:52 +00:00
hugo added the enhancement label 2026-08-08 08:11:52 +00:00
Author
Owner

Implemented and verified in commit 0a2e7dd.

Implementation:

  • Added deterministic metadata-driven callable shim generation for LibreMetaverse.Types and LibreMetaverse.StructuredData.
  • Emitted all 45 Types types and 942 members plus all 16 StructuredData types and 295 members. The generator compares emitted type/member documentation IDs with the authoritative catalog and rejects missing or stale entries.
  • Added final Rust-facing enums and duplicate/flags newtypes with exact catalog discriminants/bits, exact constants, public math fields, native UUID/OSD/container/cache layouts, generic signatures and bounds, the cache strategy trait and implementations, constructors, properties/indexers, operators, conversions, and every serializer/parser entry point.
  • Every callable non-value member uses NotImplemented or unimplemented_api!; no serialization or production behavior was added.
  • Added project-owned cross-platform replacements for external System types needed by this slice. No external member surface, CLR, FFI, subprocess, RPC, C# fallback, or platform-only API is used.
  • Added api/SHIM-COVERAGE.md and documented deterministic generation/checking and the current handover state.

Review against the issue:

  • Types coverage: 45/45 types, 942/942 members.
  • StructuredData coverage: 16/16 types, 295/295 members.
  • Focused tests verify catalog enum/alias/flag values, exact PI bits, public Color4 and native OSD layouts, and exact serializer NotImplemented member-ID propagation.
  • Compile iterations found and fixed tuple-generic duplication, raw System.Array typing, trait-object mapping, array overload naming, and an opaque external Object layout issue at their shared generator roots.

Passing tests and gates:

  • cargo test -p libremetaverse-compat-tests --test types_structured_shims
  • python3 tools/generate_api_shims.py --check
  • python3 tools/generate_rust_mapping.py --check
  • git diff --check
  • cargo fmt --all -- --check
  • cargo check -p libremetaverse-types -p libremetaverse-structured-data --all-targets
  • cargo check --workspace --all-targets
  • cargo test --workspace --no-run
  • cargo clippy --workspace --all-targets --all-features -- -D warnings
  • cargo doc --workspace --no-deps
Implemented and verified in commit 0a2e7dd. Implementation: - Added deterministic metadata-driven callable shim generation for LibreMetaverse.Types and LibreMetaverse.StructuredData. - Emitted all 45 Types types and 942 members plus all 16 StructuredData types and 295 members. The generator compares emitted type/member documentation IDs with the authoritative catalog and rejects missing or stale entries. - Added final Rust-facing enums and duplicate/flags newtypes with exact catalog discriminants/bits, exact constants, public math fields, native UUID/OSD/container/cache layouts, generic signatures and bounds, the cache strategy trait and implementations, constructors, properties/indexers, operators, conversions, and every serializer/parser entry point. - Every callable non-value member uses NotImplemented or unimplemented_api!; no serialization or production behavior was added. - Added project-owned cross-platform replacements for external System types needed by this slice. No external member surface, CLR, FFI, subprocess, RPC, C# fallback, or platform-only API is used. - Added api/SHIM-COVERAGE.md and documented deterministic generation/checking and the current handover state. Review against the issue: - Types coverage: 45/45 types, 942/942 members. - StructuredData coverage: 16/16 types, 295/295 members. - Focused tests verify catalog enum/alias/flag values, exact PI bits, public Color4 and native OSD layouts, and exact serializer NotImplemented member-ID propagation. - Compile iterations found and fixed tuple-generic duplication, raw System.Array typing, trait-object mapping, array overload naming, and an opaque external Object layout issue at their shared generator roots. Passing tests and gates: - cargo test -p libremetaverse-compat-tests --test types_structured_shims - python3 tools/generate_api_shims.py --check - python3 tools/generate_rust_mapping.py --check - git diff --check - cargo fmt --all -- --check - cargo check -p libremetaverse-types -p libremetaverse-structured-data --all-targets - cargo check --workspace --all-targets - cargo test --workspace --no-run - cargo clippy --workspace --all-targets --all-features -- -D warnings - cargo doc --workspace --no-deps
hugo closed this issue 2026-08-08 09:56:40 +00:00
Sign in to join this conversation.