Skip to main content

PortableV2Limits

Struct PortableV2Limits 

Source
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: u64

Components in the semantic manifest.

§max_entries: u64

Regular entries in the package, tag files included.

§max_entry_bytes: u64

Bytes in one entry.

§max_total_bytes: u64

Declared payload bytes across all entries.

§max_manifest_bytes: u64

Bytes 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: u64

Ceiling 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: u64

Bytes 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: usize

UTF-8 bytes in one portable path.

§copy_buffer_bytes: usize

Bytes in the streaming copy buffer.

Implementations§

Source§

impl PortableV2Limits

Source

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.

Trait Implementations§

Source§

impl Clone for PortableV2Limits

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for PortableV2Limits

Source§

impl Debug for PortableV2Limits

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PortableV2Limits

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.