diff --git a/quest/m2/README.md b/quest/m2/README.md index 0de6779abd5..bcf0ca391ae 100644 --- a/quest/m2/README.md +++ b/quest/m2/README.md @@ -94,7 +94,6 @@ lite-07; bitrate enforcement is not part of this release. - [Rust-backed @moq/net](/quest/m2/rs2ts/README.md) - measure browser baselines, complete WASM bindings, and adopt Rust behind @moq/net before the later JS-only stage - [Front parking](/quest/m2/origin-front-parks.md) - an unroutable request waits on a front instead of re-asking on every route-table move - [Route wakes](/quest/m2/route-wakes.md) - a route change wakes only the fronts it can move, so pool churn stops scaling with served paths -- [Flatten nested Options](/quest/m2/nested-options.md) - three moq-net functions stop building `Option>`, so the TS translation reaches them - [Fewer allocations in announce fan-out](/quest/m2/announce-fanout-allocs.md) - a deep path costs no more allocations per subscriber than a shallow one - [Route health](/quest/m2/route-health/README.md) - epoch-only active/passive track recovery over metadata-only subscriptions - [Wrapper traits over moq-net](/quest/m2/net-wrap/README.md) - moq-net exports producer and consumer traits, and every writer and reader above it takes them, so a wrapper such as e2ee passes through unchanged diff --git a/quest/m2/nested-options.md b/quest/m2/nested-options.md deleted file mode 100644 index ea49139b951..00000000000 --- a/quest/m2/nested-options.md +++ /dev/null @@ -1,17 +0,0 @@ -# [XS] Flatten nested Options for the TS translation - -## Goal - -`resolve_fetch_group`, `request_start`, and `Live::base` in moq-net stop building an -`Option>`, so moq-dev/rust2's TypeScript translator can translate them. -Behavior is unchanged, and the code stays at least as clear. - -## Plan - -Decided with the maintainer on 2026-10-26, from moq-dev/rust2's -[census fixes](https://github.com/moq-dev/rust2/pull/78): rewrite these three -functions in moq rather than give the translator a second `Option` -representation. Use a named enum or an early return where it reads better, and keep -a change only if it does. - -Public API: none. diff --git a/rs/moq-net/src/ietf/subscriber.rs b/rs/moq-net/src/ietf/subscriber.rs index b82572090af..afcddcca3f0 100644 --- a/rs/moq-net/src/ietf/subscriber.rs +++ b/rs/moq-net/src/ietf/subscriber.rs @@ -5951,7 +5951,8 @@ fn resolve_fetch_group(prior: Option, wire: Option) -> Result Result { diff --git a/rs/moq-net/src/model/track.rs b/rs/moq-net/src/model/track.rs index 3e8db6c49a0..b17660de935 100644 --- a/rs/moq-net/src/model/track.rs +++ b/rs/moq-net/src/model/track.rs @@ -8187,9 +8187,8 @@ pub struct Request { // unless this request was reserved on a tagged broadcast. stats: stats::Scope, - // The floor the accepted track's start is pending at, until the source resolves it - // (see [`Self::request_start`]). - requested_start: Option>, + // Where the accepted track's start is pending; see [`Self::request_start`]. + requested_start: RequestedStart, // Whether the accepted track starts idle; see [`Self::idle`]. idle: bool, @@ -8201,6 +8200,14 @@ pub struct Request { list: Option, } +/// Whether a [`Request`] asked for its accepted track's start to be pending. +enum RequestedStart { + /// The track starts as [`Request::accept`] leaves it. + Unset, + /// Pending at this floor, `None` for the live edge, until the source resolves it. + Pending(Option), +} + impl Request { pub(super) fn new(broadcast: Arc, name: impl Into>) -> Self { let name = name.into(); @@ -8215,7 +8222,7 @@ impl Request { alive, _dynamic: dynamic, stats: stats::Scope::default(), - requested_start: None, + requested_start: RequestedStart::Unset, idle: false, routes: None, list: None, @@ -8246,7 +8253,7 @@ impl Request { /// see the track. #[cfg_attr(not(feature = "async"), allow(dead_code, reason = "async-only"))] pub(crate) fn request_start(mut self, floor: impl Into>) -> Self { - self.requested_start = Some(floor.into()); + self.requested_start = RequestedStart::Pending(floor.into()); self } @@ -8345,7 +8352,7 @@ impl Request { Ok(mut state) => { state.accept(info.clone()); state.staged = true; - if let Some(floor) = self.requested_start { + if let RequestedStart::Pending(floor) = self.requested_start { state.set_start(floor, true); } if self.idle {