Define complete Rust API mapping schema

This commit is contained in:
2026-08-08 11:36:23 +02:00
parent a3e11bc39d
commit 3179d7a57d
8 changed files with 34898 additions and 11 deletions

53
api/MAPPING-COVERAGE.md Normal file
View File

@@ -0,0 +1,53 @@
# Rust mapping coverage
Generated by `python3 tools/generate_rust_mapping.py`; do not edit by hand.
## Gate
- C# public types mapped: **3,066 / 3,066 (100%)**
- C# public members mapped: **30,789 / 30,789 (100%)**
- External signature types resolved: **142 / 142 (100%)**
- Duplicate C# IDs: **0**
- Duplicate Rust destinations: **0**
- Stale or missing catalog IDs: **0**
- Unresolved referenced types: **0**
- Platform-specific mappings: **0**
## Assembly representatives
| Assembly | Rust crate | Members | Representative mapping |
|---|---|---:|---|
| `LibreMetaverse` | `libremetaverse` | 27,281 | `E:LibreMetaverse.AgentManager.AgentDataReply` -> `libremetaverse::AgentManager::agent_data_reply` |
| `LibreMetaverse.Imaging.Abstractions` | `libremetaverse-imaging` | 20 | `F:LibreMetaverse.Imaging.ManagedImage.Alpha` -> `libremetaverse_imaging::ManagedImage::alpha` |
| `LibreMetaverse.Imaging.Skia` | `libremetaverse-imaging-skia` | 3 | `M:LibreMetaverse.Imaging.Skia.SkiaTextureCodec.#ctor` -> `libremetaverse_imaging_skia::SkiaTextureCodec::new` |
| `LibreMetaverse.LslTools` | `libremetaverse-lsl-tools` | 768 | `F:LibreMetaverse.LslTools.CSToolsException.handled` -> `libremetaverse_lsl_tools::CSToolsException::handled` |
| `LibreMetaverse.PrimMesher` | `libremetaverse-prim-mesher` | 207 | `F:LibreMetaverse.PrimMesher.Coord.X` -> `libremetaverse_prim_mesher::Coord::x` |
| `LibreMetaverse.RLV` | `libremetaverse-rlv` | 499 | `E:LibreMetaverse.RLV.RlvRestrictionManager.RestrictionUpdated` -> `libremetaverse_rlv::RlvRestrictionManager::restriction_updated` |
| `LibreMetaverse.Rendering.MeshFoundry` | `libremetaverse-rendering-mesh-foundry` | 14 | `M:LibreMetaverse.Rendering.MeshFoundry.#ctor` -> `libremetaverse_rendering_mesh_foundry::MeshFoundry::new` |
| `LibreMetaverse.Rendering.Simple` | `libremetaverse-rendering-simple` | 6 | `M:LibreMetaverse.Rendering.SimpleRenderer.#ctor` -> `libremetaverse_rendering_simple::SimpleRenderer::new` |
| `LibreMetaverse.StructuredData` | `libremetaverse-structured-data` | 295 | `F:LibreMetaverse.StructuredData.OSDFormat.Binary` -> `libremetaverse_structured_data::OSDFormat::Binary` |
| `LibreMetaverse.Types` | `libremetaverse-types` | 942 | `F:LibreMetaverse.AssetType.Animation` -> `libremetaverse_types::AssetType::Animation` |
| `LibreMetaverse.Utilities` | `libremetaverse-utilities` | 13 | `F:LibreMetaverse.Utilities.WaterType.Dry` -> `libremetaverse_utilities::WaterType::Dry` |
| `LibreMetaverse.Voice.Vivox` | `libremetaverse-voice-vivox` | 531 | `E:LibreMetaverse.Voice.Vivox.TCPPipe.OnDisconnected` -> `libremetaverse_voice_vivox::TCPPipe::on_disconnected` |
| `LibreMetaverse.Voice.WebRTC` | `libremetaverse-voice-webrtc` | 210 | `E:LibreMetaverse.AudioDevice.OnAudioSourceEncodedSample` -> `libremetaverse_voice_webrtc::libre_metaverse::AudioDevice::on_audio_source_encoded_sample` |
## External replacement decisions
External member APIs are not copied. Each signature type resolves to Rust core/std, an adopted cross-platform crate, or a project-owned native compatibility type.
| Decision | Types |
|---|---:|
| `language` | 25 |
| `native_cross_platform_replacement` | 64 |
| `stdlib_or_adopted_crate` | 53 |
## Schema decisions exercised
- Properties/indexers/events: **5,090 / 11 / 268**
- Delegates and flags enums: **40 / 46**
- Optional/ref/out/in parameters: **470 / 6,144 / 555 / 0**
- Async Rust signatures: **360**
- Descriptively renamed overloads: **7,131**
- Explicit CLR delegate APM differences: **80**
Run `python3 tools/generate_rust_mapping.py --check` to regenerate in memory and enforce the complete gate.

View File

@@ -12,10 +12,13 @@ LibreMetaverse library assemblies at the pinned upstream commit. It contains:
every LibreMetaverse API that uses them.
External entries are replacement obligations, not copied dependency APIs.
Issue #3 must map each one to a Rust crate/path: use Rust core/std or an adopted
crate where it preserves the contract, otherwise define a native MetaCrate
type. The catalog deliberately does not enumerate members of SkiaSharp,
SIPSorcery, MessagePack, CoreJ2K, or any other external assembly.
`RUST-TYPES.tsv` resolves every entry to Rust core/std, an adopted
cross-platform crate, or a native MetaCrate type. Third-party API objects use
project-owned boundary types so their eventual backend can be replaced without
exposing SkiaSharp, SIPSorcery, MessagePack, CoreJ2K, or another foreign member
surface. `RUST-MAPPING.tsv` records one reviewed destination and full Rust
signature for every catalog member. `MAPPING-COVERAGE.md` is the readable gate
summary.
Regenerate from the clean pinned upstream checkout:
@@ -28,3 +31,17 @@ extractor twice against the same compiled metadata, rejects count mismatches or
duplicate documentation IDs, and writes the result only when both outputs are
byte-identical. The extractor is development-only and is absent from every
Cargo manifest and published Rust dependency graph.
Regenerate or validate the Rust mapping with only Python's standard library:
```sh
python3 tools/generate_rust_mapping.py
python3 tools/generate_rust_mapping.py --check
```
The checker rejects duplicate C# IDs, duplicate Rust destinations, invalid
statuses, stale or missing catalog entries, unresolved signature types,
assemblies without representative mappings, and platform-specific API targets.
The two support traits in `RUST-TYPES.tsv` are included because compiled public
inheritance records reference them even though they are absent from the public
type table.

30790
api/RUST-MAPPING.tsv Normal file

File diff suppressed because it is too large Load Diff

3211
api/RUST-TYPES.tsv Normal file

File diff suppressed because it is too large Load Diff