#parser #box #parser-combinator #builder #nom #zero-copy #content


A JUMBF (ISO/IEC 19566-5:2023) parser and builder written in pure Rust

6 releases (3 breaking)

0.4.0 Mar 27, 2024
0.3.0 Mar 22, 2024
0.2.2 Mar 13, 2024
0.1.0 Mar 12, 2024

#420 in Parser implementations

Download history 279/week @ 2024-03-10 135/week @ 2024-03-17 357/week @ 2024-03-24 122/week @ 2024-03-31 79/week @ 2024-04-07 12/week @ 2024-04-14 16/week @ 2024-04-21 19/week @ 2024-04-28 8/week @ 2024-05-05 8/week @ 2024-05-12

54 downloads per month




A JUMBF (ISO/IEC 19566-5:2023) parser and builder written in pure Rust.

CI Latest Version docs.rs codecov


The parser is implemented with the nom parser combinator framework and makes extensive use of zero-copy. Since the parsing features of this crate include dependencies on nom and thiserror, those features are gated on a crate feature named parser, which is included by default.

This crate is intentionally minimal in its understanding of box content. Only jumb (superbox) and jumd (description box) content are understood. The content of all other box types (including other types described in the JUMBF standard) is generally application-specific and thus the meaning of that content is left to the caller.

use hex_literal::hex;
use jumbf::parser::{DescriptionBox, SuperBox};

let jumbf = hex!(
    "0000002f" // box size
    "6a756d62" // box type = 'jumb'
        "00000027" // box size
        "6a756d64" // box type = 'jumd'
        "00000000000000000000000000000000" // UUID
        "03" // toggles
        "746573742e7375706572626f7800" // label

let (rem, sbox) = SuperBox::from_slice(&jumbf).unwrap();

    SuperBox {
        desc: DescriptionBox {
            uuid: &[0; 16],
            label: Some("test.superbox"),
            requestable: true,
            id: None,
            hash: None,
            private: None,
            original: &jumbf[8..47],
        child_boxes: vec!(),
        original: &jumbf,


This crate also allows you to build JUMBF data structures and serialize them.

use std::io::Cursor;

use hex_literal::hex;
use jumbf::{builder::{DataBoxBuilder, SuperBoxBuilder}, BoxType};

const JSON_BOX_TYPE: BoxType = BoxType(*b"json");
const RANDOM_BOX_TYPE: BoxType = BoxType(*b"abcd");

let child_box1 = DataBoxBuilder::from_owned(

let child_box2 = DataBoxBuilder::from_borrowed(RANDOM_BOX_TYPE, b"ABCD");

let sbox = SuperBoxBuilder::new(&hex!("00000000000000000000000000000000"))

let mut jumbf = Cursor::new(Vec::<u8>::new());
sbox.write_jumbf(&mut jumbf).unwrap();

Reduced dependencies for builder only

The builder can be built by itself and has no third-party crate dependencies in that configuration. If you only need to build JUMBF data structures and want to reduce compile-time overhead, you can disable the parser feature by importing this crate as follows:

jumbf = { version = "x.x", default-features = false }

Contributions and feedback

We welcome contributions to this project. For information on contributing, providing feedback, and about ongoing work, see Contributing.


The crate requires Rust version 1.74.0 or newer. When a newer version of Rust becomes required, a new minor (1.x.0) version of this crate will be released.

Supported platforms

The crate has been tested on the following operating systems:

  • Windows (IMPORTANT: Only the MSVC build chain is supported on Windows. We would welcome a PR to enable GNU build chain support on Windows.)
  • MacOS (Intel and Apple silicon)
  • Ubuntu Linux on x86 and ARM v8 (aarch64)


The jumbf crate is distributed under the terms of both the MIT license and the Apache License (Version 2.0).


Note that some components and dependent crates are licensed under different terms; please check the license terms for each crate and component for details.


Refer to the CHANGELOG for detailed changes derived from Git commit history.