pub struct PortableV2Limits {
pub max_components: u64,
pub max_entries: u64,
pub max_entry_bytes: u64,
pub max_total_bytes: u64,
pub max_manifest_bytes: u64,
pub max_semantic_manifest_bytes: u64,
pub max_tag_manifest_bytes: u64,
pub max_path_bytes: usize,
pub copy_buffer_bytes: usize,
}Expand description
Writer and reader admission limits for portable-v2 packages.
Limits that grow with the entry count admit every package a project can produce (#900): the payload inventory streams, and the semantic manifest is bounded per package by the entries it actually lists.
Fields§
§max_components: u64Components in the semantic manifest.
max_entries: u64Regular entries in the package, tag files included.
max_entry_bytes: u64Bytes in one entry.
max_total_bytes: u64Declared payload bytes across all entries.
max_manifest_bytes: u64Bytes in each retained JSON control whose size does not grow with the
entry count: the runtime map, the ontology composition, and ontology
and bridge documents in aggregate. It is also the semantic manifest’s
fixed allowance; see Self::semantic_manifest_bound.
max_semantic_manifest_bytes: u64Ceiling on the semantic manifest, data/graphforge-project.json,
whatever its entry count. It is parsed whole, so this bounds reader
memory under untrusted input.
max_tag_manifest_bytes: u64Bytes in each retained tag file: bagit.txt, bag-info.txt and
tagmanifest-sha256.txt, which has three rows. The payload inventory,
manifest-sha256.txt, has one row per data/ entry; writer and reader
stream it, and it is bounded by max_entries and max_path_bytes.
max_path_bytes: usizeUTF-8 bytes in one portable path.
copy_buffer_bytes: usizeBytes in the streaming copy buffer.
Implementations§
Source§impl PortableV2Limits
impl PortableV2Limits
Sourcepub fn semantic_manifest_bound(&self, entries: u64) -> u64
pub fn semantic_manifest_bound(&self, entries: u64) -> u64
Largest semantic manifest admitted for a package of entries regular
entries, checked before it is parsed: the fixed max_manifest_bytes
allowance for components and selection, plus one file-record budget
per entry, never above max_semantic_manifest_bytes. A small package
therefore cannot present a large manifest.