#[non_exhaustive]pub struct Limits {
pub max_input_bytes: u64,
}Expand description
Resource ceilings applied before and during parsing.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.max_input_bytes: u64Largest input strypt will read, in bytes.
Implementations§
Source§impl Limits
impl Limits
Sourcepub const DEFAULT_MAX_INPUT_BYTES: u64
pub const DEFAULT_MAX_INPUT_BYTES: u64
The default input ceiling: 512 MiB.
Chosen to clear the largest files the Phase 1 formats plausibly produce — a high-resolution scanned PDF runs to a few hundred megabytes — while still refusing a file whose only purpose is to exhaust memory. It is a ceiling on the input; a PDF rewrite holds the parsed document as well, so peak usage is a multiple of this. That matters on the constrained, RAM-only systems this tool is aimed at, which is why the number is deliberately not “as much as will fit”.
Provisional: revisit with measured figures once the handlers exist (docs/PRD.md §9
still carries estimates rather than measurements).
Source§impl Limits
impl Limits
Sourcepub const fn with_max_input_bytes(max_input_bytes: u64) -> Self
pub const fn with_max_input_bytes(max_input_bytes: u64) -> Self
Limits with a caller-chosen input ceiling.
A constructor rather than a struct literal because this type is #[non_exhaustive]:
new ceilings will be added, and a front-end built against an older version must keep
compiling rather than silently missing one.
Trait Implementations§
impl Copy for Limits
impl Eq for Limits
impl StructuralPartialEq for Limits
Auto Trait Implementations§
impl Freeze for Limits
impl RefUnwindSafe for Limits
impl Send for Limits
impl Sync for Limits
impl Unpin for Limits
impl UnsafeUnpin for Limits
impl UnwindSafe for Limits
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.