Skip to main content

Limits

Struct Limits 

Source
pub struct Limits { /* private fields */ }
Expand description

Bounds checked against declared sizes before any file region is read.

Specification section 2 requires readers to validate length arithmetic for overflow and recommends configurable resource limits. Each bound is an inclusive maximum; a larger declared size fails with ErrorKind::ResourceLimit.

Most bounds describe one structure. Two describe a whole Scan instead, and are spent cumulatively across its blocks: Self::max_rows_per_scan and Self::max_decoded_scan_bytes. Both default to no limit, so an existing scan cannot acquire a surprising cap, and both charge only for work the scan really does: a pruned block and an unprojected column cost nothing. Per-block bounds still apply on top of them, and Reader::read_block is a single block decode that never sees a scan’s cumulative state.

let limits = acta::Limits::default().with_max_frame_payload_length(1 << 20);
assert_eq!(limits.max_frame_payload_length(), 1 << 20);

Implementations§

Source§

impl Limits

Source

pub fn max_frame_header_length(&self) -> u64

The largest frame header length this configuration accepts.

Source

pub fn max_frame_payload_length(&self) -> u64

The largest frame payload length this configuration accepts.

Source

pub fn max_schema_columns(&self) -> u64

The largest schema column count accepted by metadata parsing.

Source

pub fn max_schema_field_length(&self) -> u64

The largest column name or encoded type-parameter record accepted by metadata parsing.

Source

pub fn max_blocks(&self) -> u64

The largest number of data blocks retained in one reader snapshot.

Source

pub fn max_rows_per_block(&self) -> u64

The largest block row count a logical decoder will materialize.

Source

pub fn max_decoded_block_bytes(&self) -> u64

The largest total number of bytes one block decode may materialize.

The allowance covers every buffer a decode creates, including the stored and decompressed stream bytes and the intermediate value representations, and it is not refunded when a buffer is released.

Source

pub fn max_rows_per_scan(&self) -> u64

The largest number of block rows one scan may decode cumulatively.

A block is charged for the rows it decodes, which is its whole row count: a range filter narrows what the scan returns, not what it had to materialize to decide. Pruned blocks decode nothing and are not charged.

Source

pub fn max_decoded_scan_bytes(&self) -> u64

The largest number of decoded and intermediate bytes one scan may charge cumulatively across all its blocks and selected columns.

Source

pub fn with_max_frame_header_length(self, bytes: u64) -> Self

Return these limits with a different maximum frame header length.

Source

pub fn with_max_frame_payload_length(self, bytes: u64) -> Self

Return these limits with a different maximum frame payload length.

Source

pub fn with_max_schema_columns(self, columns: u64) -> Self

Return these limits with a different maximum schema column count.

Source

pub fn with_max_schema_field_length(self, bytes: u64) -> Self

Return these limits with a different maximum schema field length.

Source

pub fn with_max_blocks(self, blocks: u64) -> Self

Return these limits with a different maximum block count.

Source

pub fn with_max_rows_per_block(self, rows: u64) -> Self

Return these limits with a different maximum decoded block row count.

Source

pub fn with_max_decoded_block_bytes(self, bytes: u64) -> Self

Return these limits with a different decoded block memory allowance.

Source

pub fn with_max_rows_per_scan(self, rows: u64) -> Self

Return these limits with a different cumulative scan row allowance.

Source

pub fn with_max_decoded_scan_bytes(self, bytes: u64) -> Self

Return these limits with a different cumulative scan decoded-byte allowance.

Trait Implementations§

Source§

impl Clone for Limits

Source§

fn clone(&self) -> Limits

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 Limits

Source§

impl Debug for Limits

Source§

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

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

impl Default for Limits

Source§

fn default() -> Self

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

impl Eq for Limits

Source§

impl PartialEq for Limits

Source§

fn eq(&self, other: &Limits) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Limits

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> 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 = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.