#[non_exhaustive]pub struct Diagnostic {Show 13 fields
pub trace_captured: bool,
pub reason: Option<DiagnosticReason>,
pub data_path: Option<String>,
pub generated_source: bool,
pub host_cause: Option<Arc<dyn Error + Send + Sync>>,
pub source: Option<Arc<str>>,
pub line: Option<u32>,
pub unclosed_block: Option<(u32, &'static str)>,
pub span: Option<DiagnosticSpan>,
pub snapshot: Option<Arc<SourceSnapshot>>,
pub report_bytes: usize,
pub frames: Vec<DiagnosticFrame>,
pub frames_truncated: bool,
}Expand description
Source details and call frames that remain available after reset or drop.
This data is separate from the script’s error value and never changes what
pcall receives. Source and frames may be absent when their budgets are zero.
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.trace_captured: boolWhether runtime call-trace capture has been performed. This can be true even when no frames were retained.
reason: Option<DiagnosticReason>Structured facts from the failing operation, when they were captured.
data_path: Option<String>The field or array path associated with a data-conversion failure, when known.
generated_source: boolWhether the failure falls in generated wrapper text rather than mapped input.
host_cause: Option<Arc<dyn Error + Send + Sync>>The original typed host error, when a host cause was preserved.
source: Option<Arc<str>>The source label, when known; it need not name a file on disk.
line: Option<u32>The one-based source line, when known.
unclosed_block: Option<(u32, &'static str)>The one-based opening line and expected closing keyword for an unclosed block.
span: Option<DiagnosticSpan>The half-open source byte range, when known. A source map may adjust it to refer to the retained input rather than generated wrapper text.
snapshot: Option<Arc<SourceSnapshot>>Retained source text for this failure. It may be absent when the source or total retention budget is exceeded, allocation fails, or source is unavailable.
report_bytes: usizeThe maximum UTF-8 byte length of crate::Error::report output.
This is a formatting budget, not the current report’s length; zero emits nothing.
frames: Vec<DiagnosticFrame>Captured caller frames, starting with the caller nearest the failure. An empty list can mean no callers, disabled capture, or unavailable frame data.
frames_truncated: boolWhether additional call frames were omitted when capture reached its bound.
Trait Implementations§
Source§impl Clone for Diagnostic
impl Clone for Diagnostic
Source§fn clone(&self) -> Diagnostic
fn clone(&self) -> Diagnostic
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more