1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
/// A one-shot iterator that yields a single 31-byte wire packet.
///
/// Used as the [`IntoPackets::Iter`] type for all single-packet InfoFrame
/// types (AVI, Audio, HDR Static Metadata, HDMI Forum VSI).
;
/// Yields one or more 31-byte wire packets representing an InfoFrame.
///
/// Traditional InfoFrame types (AVI, Audio, HDR Static Metadata, HDMI Forum VSI)
/// yield exactly one packet. Dynamic HDR yields as many packets as the metadata
/// payload requires.
///
/// The iterator owns the frame — `into_packets` moves `self`. Callers that need
/// to retain the frame after encoding should clone before calling.
///
/// # Warnings
///
/// Like the decode path, `into_packets` returns a [`Decoded`](crate::decoded::Decoded) that pairs the
/// packet iterator with any warnings produced during encoding. Callers should
/// check [`Decoded::iter_warnings`](crate::decoded::Decoded::iter_warnings) before transmitting packets.
///
/// # Example
///
/// ```rust
/// # use cartouche::encode::IntoPackets;
/// # fn transmit(_: &[u8; 31]) {}
/// # fn example<F: IntoPackets>(frame: F) {
/// let encoded = frame.into_packets();
/// // (check encoded.iter_warnings() here)
/// for packet in encoded.value {
/// transmit(&packet);
/// }
/// # }
/// ```