Pack

  • file format 6
  • Rust SDK 1.0 preview

Opening a pack and reading its parts. A Pack holds the whole file in one buffer, verified on open unless the options say otherwise.

On this page, Result<T> is std::result::Result<T, plxi_sdk::Error>.

Every public struct and enum with a public field or variant is marked #[non_exhaustive]: code outside the crate builds one through its constructors and matches an enum with a _ arm.

Structs

struct

OpenOptions

Spec §9
#[non_exhaustive]
#[derive(Debug, Clone, Copy, PartialEq, Eq)]
pub struct OpenOptions {
    pub verify: bool,
    pub max_input_bytes: Option<u64>,
}

impl Default for OpenOptions
Summary

How to open a pack.

The default verifies (spec §9 steps 1-8); a caller that must read a damaged pack opts out with OpenOptions::no_verify and accepts that records may come from a damaged body.

Fields
  • verify: boolRun verify steps 1-8 at open (default true).
  • max_input_bytes: Option<u64>Refuse input (and, for .plxi.gz, inflated output) larger than this many bytes with limit_exceeded. None (the default) sets no cap: the SDK does not guess a capacity.
method

OpenOptions::no_verify

Spec §9
pub fn no_verify() -> Self
Summary

Open without verifying the digest, the header/footer agreement or the records. The framing checks the reader needs (size, header grammar, footer, layout) still run.

Parameters
None.
Returns
Self
method

Pack::from_bytes

Spec §9
pub fn from_bytes(bytes: Vec<u8>, opts: OpenOptions) -> Result<Pack>
Summary

Open a pack held in memory. Input that starts with the gzip magic is inflated first (spec §11). No file is read or written.

With opts.verify (the default) the pack passes spec §9 steps 1-8 or the kind of the first failing step is returned.

Parameters
  • bytes: Vec<u8>
  • opts: OpenOptions
Returns
Result<Pack>
Errors

The kind of the first failing step; limit_exceeded over max_input_bytes.

method

Pack::records

Spec §4
pub fn records(&self) -> impl Iterator<Item = Result<Record>> + '_
Summary

Iterate the records in file order.

A body that is not UTF-8, or whose appendix marker is misplaced, yields one error item and nothing else.

Parameters
None.
Returns
impl Iterator<Item = Result<Record>> + '_
method

Pack::records_filtered

Spec §5.3
pub fn records_filtered<'a>(
    &'a self,
    filter: &'a Filter,
) -> impl Iterator<Item = Result<Record>> + 'a
Summary

Iterate the records filter keeps, in file order.

Parameters
  • filter: &'a Filter
Returns
impl Iterator<Item = Result<Record>> + 'a
method

Pack::appendix

Spec §7
pub fn appendix(&self) -> Result<Option<Appendix<'_>>>
Summary

The embedded CSDT appendix, opened over the pack's own buffer with no copy and no file. None when the pack has no appendix.

Parameters
None.
Returns
Result<Option<Appendix<'_>>>
Errors

Appendix kinds from the container checks made when the appendix is opened (spec §9 step 9).

© 2020-2026 Cintile Inc. All Rights Reserved.

Anyone may implement this format. Copying or republishing the text of this specification requires permission from Cintile Inc.

Sections