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
impl Limits
Sourcepub fn max_frame_header_length(&self) -> u64
pub fn max_frame_header_length(&self) -> u64
The largest frame header length this configuration accepts.
Sourcepub fn max_frame_payload_length(&self) -> u64
pub fn max_frame_payload_length(&self) -> u64
The largest frame payload length this configuration accepts.
Sourcepub fn max_schema_columns(&self) -> u64
pub fn max_schema_columns(&self) -> u64
The largest schema column count accepted by metadata parsing.
Sourcepub fn max_schema_field_length(&self) -> u64
pub fn max_schema_field_length(&self) -> u64
The largest column name or encoded type-parameter record accepted by metadata parsing.
Sourcepub fn max_blocks(&self) -> u64
pub fn max_blocks(&self) -> u64
The largest number of data blocks retained in one reader snapshot.
Sourcepub fn max_rows_per_block(&self) -> u64
pub fn max_rows_per_block(&self) -> u64
The largest block row count a logical decoder will materialize.
Sourcepub fn max_decoded_block_bytes(&self) -> u64
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.
Sourcepub fn max_rows_per_scan(&self) -> u64
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.
Sourcepub fn max_decoded_scan_bytes(&self) -> u64
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.
Sourcepub fn with_max_frame_header_length(self, bytes: u64) -> Self
pub fn with_max_frame_header_length(self, bytes: u64) -> Self
Return these limits with a different maximum frame header length.
Sourcepub fn with_max_frame_payload_length(self, bytes: u64) -> Self
pub fn with_max_frame_payload_length(self, bytes: u64) -> Self
Return these limits with a different maximum frame payload length.
Sourcepub fn with_max_schema_columns(self, columns: u64) -> Self
pub fn with_max_schema_columns(self, columns: u64) -> Self
Return these limits with a different maximum schema column count.
Sourcepub fn with_max_schema_field_length(self, bytes: u64) -> Self
pub fn with_max_schema_field_length(self, bytes: u64) -> Self
Return these limits with a different maximum schema field length.
Sourcepub fn with_max_blocks(self, blocks: u64) -> Self
pub fn with_max_blocks(self, blocks: u64) -> Self
Return these limits with a different maximum block count.
Sourcepub fn with_max_rows_per_block(self, rows: u64) -> Self
pub fn with_max_rows_per_block(self, rows: u64) -> Self
Return these limits with a different maximum decoded block row count.
Sourcepub fn with_max_decoded_block_bytes(self, bytes: u64) -> Self
pub fn with_max_decoded_block_bytes(self, bytes: u64) -> Self
Return these limits with a different decoded block memory allowance.
Sourcepub fn with_max_rows_per_scan(self, rows: u64) -> Self
pub fn with_max_rows_per_scan(self, rows: u64) -> Self
Return these limits with a different cumulative scan row allowance.
Sourcepub fn with_max_decoded_scan_bytes(self, bytes: u64) -> Self
pub fn with_max_decoded_scan_bytes(self, bytes: u64) -> Self
Return these limits with a different cumulative scan decoded-byte allowance.