pub enum NixTraceFrame {
Eager {
file: Option<String>,
description: String,
},
Lambda {
closure_env: Env,
current_file: Option<PathBuf>,
},
}Expand description
A single frame in the Nix-level error trace.
The frame is only ever observed on the cold error path (via
attach_trace). To keep the hot lambda-call path allocation-free,
the per-call lambda frame stores the raw ingredients (a cheap
Rc-clone of the closure env + the raw current-eval-file PathBuf)
and defers the format! / path-strip work into attach_trace. The
rendered (description, file) pair is byte-identical to the eager
form either way (see the description() / file() accessors).
Variants§
Eager
Pre-formatted frame (the builtin-call path — kept eager because
the builtin name is already a &'static str, so there is no
per-call heap-String to defer).
Lambda
Lazy per-lambda-call frame. The description string and the
stripped file string are built on demand in attach_trace.
closure_envprovides the description’s file (fromclosure.env.eval_file()) — an O(1)Rcrefcount bump.current_fileis the rawcurrent_eval_file()snapshot taken at push time (the stack top after the file guard pushed the closure’s file), used verbatim for the frame’sfilefield so the renderedlocmatches the eager form byte-for-byte.
Trait Implementations§
Source§impl Clone for NixTraceFrame
impl Clone for NixTraceFrame
Source§fn clone(&self) -> NixTraceFrame
fn clone(&self) -> NixTraceFrame
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for NixTraceFrame
impl Debug for NixTraceFrame
Source§impl Display for NixTraceFrame
The frame’s rendered description IS its Display — the typed emission
surface for the trace message (write!, never format!()). The
Lambda arm defers the path-strip to this cold error-path render.
impl Display for NixTraceFrame
The frame’s rendered description IS its Display — the typed emission
surface for the trace message (write!, never format!()). The
Lambda arm defers the path-strip to this cold error-path render.
Auto Trait Implementations§
impl !RefUnwindSafe for NixTraceFrame
impl !Send for NixTraceFrame
impl !Sync for NixTraceFrame
impl !UnwindSafe for NixTraceFrame
impl Freeze for NixTraceFrame
impl Unpin for NixTraceFrame
impl UnsafeUnpin for NixTraceFrame
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.