Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions quest/m1/ffi-export/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Every generator on the C ABI:

- [Payloads cross as bytes](/quest/m1/ffi-export/payload-bytes.md) - a payload that is not UTF-8 crosses unchanged, where today it aborts from C, C++, and Kotlin
- [Iterator and JSON arguments the exporter can't map yet](/quest/m1/ffi-export/instance-keys.md) - `IntoIterator` as a `Vec`, and `serde_json::Value`
- [Returned iterators cross as arrays](/quest/m1/ffi-export/iterators.md) - `Hops::iter`, `Versions::iter`, and `Patterns::iter` export, returning arrays as `&[T]` does
- [moq-clock's C names once it moves into kio](/quest/m1/ffi-export/crates.md) - `moq_now` and `moq_origin` become the clock's, after moq moves it into `kio::clock`
- [Sessions on moq-tokio](/quest/m1/ffi-export/session-tokio.md) - bindings connect and accept with one call, the library running moq-tokio inside
- [Sessions on sans-IO QUIC](/quest/m1/ffi-export/session-quic.md) - bindings move UDP datagrams and drive the session's poll themselves
Expand Down
21 changes: 21 additions & 0 deletions quest/m1/ffi-export/iterators.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# [S] Returned iterators cross as arrays

## Goal

moq-net's `Hops::iter` and `Versions::iter` and moq-pattern's `Patterns::iter` export
without being excluded in `ffi/moq/ffi.toml`, each returning what it iterates as an array,
as a `&[T]` return crosses. This comes from a fixed rule, with no config.

## Plan

Found by [#205](https://github.com/kixelated/rust2/pull/205) on 2026-10-28, which exports
`&[T]` of any type.

- `std::slice::Iter<'_, T>` is a borrowed slice, so it crosses exactly as `&[T]` does.
- `Versions::iter` returns `impl Iterator<Item = &Version>`. Collecting it at the return is
exact only for an iterator that reads borrowed data, with no side effect and an end;
decide which `impl Iterator` returns the rule takes when the quest starts, and refuse the
rest with a span.
- Report moq-ffi's coverage and the census before and after.

Public API: the C names and types these methods export with.
1 change: 1 addition & 0 deletions quest/m3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ generic std gap is planned here even when moq never calls it.
- [Binding gaps](/quest/m3/ts-bind-gaps.md) - bound types as keys, unit returns checked, renamed dependencies
- [Drop order in std's folds and iterators](/quest/m3/ts-drop-order.md) - the values that drop still refused in std's folds, zips, flattens, and collects drop as std's do
- [Checks on the differential harnesses](/quest/m3/ts-harness.md) - step lists that drift, literal op bytes, and `refs`'s coverage fail a test or get cases
- [Edits of byte vectors and slices](/quest/m3/ts-byte-edits.md) - `retain`, `dedup`, `insert`, `remove`, and the rest translate on `Vec<u8>` and `[u8]` as on other elements
- [Ordering in std](/quest/m3/ts-ordering.md) - `cmp::max`/`min`, `is_sorted`, and `BinaryHeap`, and #173's cost on integers measured
- [Debug and Display of Arc and ranges](/quest/m3/ts-fmt-wrappers.md) - `Arc<T>` formats as `T`, and ranges as std's `Debug`
- [Fold a match a bool decided](/quest/m3/ts-fold-bool.md) - `if matches!` and derived `==` drop a later match's dead arms
Expand Down
21 changes: 21 additions & 0 deletions quest/m3/ts-byte-edits.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# [S] Edits of byte vectors and slices

## Goal

rust2-ts translates every `Vec` and slice method on `Vec<u8>` and `[u8]` that it translates
for other element types, such as `retain`, `retain_mut`, `dedup`, `insert`, `remove`,
`swap_remove`, and the slice's `last`, `reverse`, `swap`, and sorts, proven by differential
tests against native Rust.

## Plan

Found by [#204](https://github.com/kixelated/rust2/pull/204) on 2026-10-28, whose fixture
hit `retain` on a `Vec<u8>`: the mappings in `library.rs` skip `u8` elements, which are an
`rt.ByteVec` or `rt.ByteSlice` rather than an array, and nothing maps them instead. rust2
aims to support all of std, so this has no moq consumer.

- Find every such skip rather than only the methods named here, and give each the
`rt.ByteVec` or `rt.ByteSlice` counterpart, with the closure's drop and the element's
equality as the generic path has them.

Public API: the translator's output.