xdf/parsers/
boundary.rs

1// boundary structure
2// [UUID]
3// [0x43 0xA5 0x46 0xDC 0xCB 0xF5 0x41 0x0F 0xB3 0x0E 0xD5 0x46 0x73 0x83 0xCB 0xE4]
4// [16]
5
6use nom::{bytes::complete::tag, error::context, IResult};
7
8use crate::BoundaryChunk;
9
10use super::{chunk_length::length, chunk_tags::boundary_tag};
11
12pub(crate) fn boundary(input: &[u8]) -> IResult<&[u8], BoundaryChunk> {
13    let (input, _chunk_size) = context("boundary chunk_size", length)(input)?;
14    let (input, _tag) = context("boundary tag", boundary_tag)(input)?; // 2 bytes
15    let (input, _boundary_bytes) = context(
16        "boundary boundary_bytes",
17        tag([
18            0x43, 0xA5, 0x46, 0xDC, 0xCB, 0xF5, 0x41, 0x0F, 0xB3, 0x0E, 0xD5, 0x46, 0x73, 0x83, 0xCB, 0xE4,
19        ]),
20    )(input)?;
21
22    Ok((input, BoundaryChunk {}))
23}