Skip to content

implement rtng box#136

Open
bradh wants to merge 1 commit intokixelated:mainfrom
bradh:rtng_2026-01-31
Open

implement rtng box#136
bradh wants to merge 1 commit intokixelated:mainfrom
bradh:rtng_2026-01-31

Conversation

@bradh
Copy link
Collaborator

@bradh bradh commented Jan 31, 2026

This is from 3GPP TS 26.244 or ETSI TS 126 244 Table 8.7

Resolves #118

@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

Walkthrough

Adds support for a new Rtng atom type. Introduces a public Rtng struct with fields entity, criteria, language, and rating_info, plus AtomExt encode/decode implementations and unit tests. Exposes a new rtng module and pub use rtng::*;. Adds Any::Rtng variant to the generated Any enum. Extends Udta with pub rtng: Option<Rtng> and updates nested optional list and tests accordingly.

🚥 Pre-merge checks | ✅ 4 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The PR title 'implement rtng box' directly and clearly describes the main change: implementing the rtng box as a new atom variant.
Description check ✅ Passed The PR description references the relevant specification (3GPP TS 26.244 / ETSI TS 126 244 Table 8.7) and links to the resolved issue #118, which is directly related to the rtng box implementation.
Linked Issues check ✅ Passed The code changes fully implement the rtng box as specified in ETSI TS 126 244 Table 8.7 by adding the Rtng struct with required fields (entity, criteria, language, rating_info) and encoding/decoding support.
Out of Scope Changes check ✅ Passed All changes are within scope: new Rtng enum variant in Any, Rtng module/struct in udta, optional field in Udta, and encode/decode implementations directly implement the rtng box specification.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/moov/udta/rtng.rs`:
- Around line 61-68: Test formatting for the Rtng assert fails rustfmt — run
rustfmt (cargo fmt) and update the formatting around the assert_eq! comparing
the Rtng struct so it matches rustfmt's expected layout (ensure proper
indentation, trailing commas, and alignment for the Rtng { entity, criteria,
language, rating_info } literal used in the assert_eq!); target the Rtng struct
literal and the assert_eq! invocation to normalize spacing/line breaks.
🧹 Nitpick comments (1)
src/moov/udta/rtng.rs (1)

38-43: Validate language codes to avoid silent truncation.
language_code(&self.language) only uses the first three UTF-16 code units; longer strings will be truncated. If the spec requires ISO‑639 3‑letter codes, please validate length/charset and return an error for invalid inputs.

This is from 3GPP TS 26.244 or ETSI TS 126 244 Table 8.7
Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@src/moov/udta/rtng.rs`:
- Around line 12-45: The rtng atom is a FullBox and must read/write the 4-byte
FullBox header (8-bit version + 24-bit flags) before the
entity/criteria/language; update decode_body_ext and encode_body_ext on Rtng to
consume/emit those bytes. In decode_body_ext call u8::decode to read the version
and then read the 3 flag bytes (or decode a u32 and mask off the low 24 bits)
before decoding entity/criteria/language, validating or ignoring the values
(spec expects 0). In encode_body_ext write a zero version byte and zero 24-bit
flags (emit 4 zero bytes) before encoding self.entity, self.criteria, language
code, and rating_info so the FullBox header is present.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

missing box - rtng

1 participant