pub struct ScanLimits { /* private fields */ }Expand description
Optional total-work budgets for streaming COPY row scans.
Unlike Limits, these budgets accumulate work across rows. max_rows counts
complete rows evaluated/yielded by the scan. max_decompressed_bytes counts
physical decompressed COPY bytes actually consumed by the parser, including field
separators, row terminators, and the COPY terminator when consumed. Decoder or
buffered-reader lookahead that has not been consumed by the parser does not count,
and logical post-unescape field length is not used.
A configured value is inclusive. A row that would make either counter exceed its
limit is not exposed to the caller or predicate. ScanLimits::unlimited and
Default apply neither budget; applications handling untrusted or very large
inputs should choose explicit bounds appropriate to the operation.
Raw byte extraction uses the separate crate::EntryReadLimits budget.
Implementations§
Source§impl ScanLimits
impl ScanLimits
Sourcepub const fn max_rows(self) -> Option<u64>
pub const fn max_rows(self) -> Option<u64>
Returns the inclusive maximum number of complete rows, if configured.
Sourcepub const fn max_decompressed_bytes(self) -> Option<u64>
pub const fn max_decompressed_bytes(self) -> Option<u64>
Returns the inclusive maximum parser-consumed decompressed byte count, if configured.
Sourcepub const fn with_max_rows(self, value: u64) -> Self
pub const fn with_max_rows(self, value: u64) -> Self
Returns a configuration with a maximum complete-row budget.
A value of N permits exactly N complete rows; the next row is rejected
before it is exposed to the caller or predicate.
Sourcepub const fn with_max_decompressed_bytes(self, value: u64) -> Self
pub const fn with_max_decompressed_bytes(self, value: u64) -> Self
Returns a configuration with a maximum parser-consumed decompressed-byte budget.
A value of N permits exactly N consumed COPY bytes. Consuming byte N + 1
produces a typed scan resource error before a crossing row is exposed.
Trait Implementations§
Source§impl Clone for ScanLimits
impl Clone for ScanLimits
Source§fn clone(&self) -> ScanLimits
fn clone(&self) -> ScanLimits
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more