#[non_exhaustive]pub struct DiagnosticLimits {
pub retained_source_bytes: usize,
pub source_bytes: usize,
pub frames: usize,
pub report_bytes: usize,
}Expand description
Host-side reporting budgets, separate from script fuel and memory limits.
Start with default and adjust the limits your application
needs. Defaults are 4 MiB of retained-source accounting, 256 KiB per source,
32 captured frames, and 16 KiB per formatted report. These limits do not
constrain script execution or change the error value received by pcall.
A zero source budget omits nonempty source text while retaining available
locations; zero frames disables frame storage, and zero report bytes produces
an empty report for captured diagnostics. Errors without captured diagnostics
use the formatter’s fallback budget instead.
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.retained_source_bytes: usizeTotal budget for retained source snapshots, including accounting overhead, shared by compiled scripts and outstanding errors. Measured in bytes.
source_bytes: usizeMaximum source length in bytes retained for one script. A larger source is omitted rather than stored as a partial snapshot.
frames: usizeMaximum number of captured script frames.
report_bytes: usizeMaximum bytes written by a formatted error report.
Implementations§
Source§impl DiagnosticLimits
impl DiagnosticLimits
Sourcepub const fn retained_source_bytes(&self) -> usize
pub const fn retained_source_bytes(&self) -> usize
Returns the total retained-source budget.
Sourcepub const fn source_bytes(&self) -> usize
pub const fn source_bytes(&self) -> usize
Returns the largest source retained for one script.
Sourcepub const fn report_bytes(&self) -> usize
pub const fn report_bytes(&self) -> usize
Returns the maximum formatted report size.
Sourcepub const fn with_retained_source_bytes(self, bytes: usize) -> Self
pub const fn with_retained_source_bytes(self, bytes: usize) -> Self
Sets the total retained-source budget.
Sourcepub const fn with_source_bytes(self, bytes: usize) -> Self
pub const fn with_source_bytes(self, bytes: usize) -> Self
Sets the maximum source size retained for one script.
Sourcepub const fn with_frames(self, frames: usize) -> Self
pub const fn with_frames(self, frames: usize) -> Self
Sets the number of frames captured for one error.
Sourcepub const fn with_report_bytes(self, bytes: usize) -> Self
pub const fn with_report_bytes(self, bytes: usize) -> Self
Sets the maximum formatted report size.
Trait Implementations§
Source§impl Clone for DiagnosticLimits
impl Clone for DiagnosticLimits
Source§fn clone(&self) -> DiagnosticLimits
fn clone(&self) -> DiagnosticLimits
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more