pub struct DebugPool {
pub string_pool: Vec<String>,
pub span_pool: Vec<Span>,
pub type_pool: Vec<Vec<u8>>,
pub records: Vec<DebugRecord>,
}Expand description
The chunk-local debug metadata section: three data sub-pools holding variable-length payloads, plus the record pool of op-index-keyed markers that reference them.
Fields§
§string_pool: Vec<String>Interned UTF-8 strings (file names, variable names, …).
span_pool: Vec<Span>Source spans referenced by records.
type_pool: Vec<Vec<u8>>Compact type representations referenced by TypeAnnotation
records. Held as opaque length-prefixed byte blobs in this
foundational increment; the concrete TypeRepr encoding is
defined when TypeAnnotation emission lands.
records: Vec<DebugRecord>The op-index-keyed annotation records.
Implementations§
Source§impl DebugPool
impl DebugPool
Sourcepub fn is_empty(&self) -> bool
pub fn is_empty(&self) -> bool
True when the pool carries no data and no records. An absent pool and an empty pool are distinct at the chunk level (an absent pool omits the section entirely); this helper lets a producer collapse an empty pool to absent.
Sourcepub fn encode(&self) -> Vec<u8> ⓘ
pub fn encode(&self) -> Vec<u8> ⓘ
Encode the pool to its canonical byte form. Records are sorted into canonical order (op index, then kind, then operands) so the output is byte-deterministic for a given logical pool regardless of record insertion order. The data sub-pools are emitted in their stored order; see the module-level determinism note.
Sourcepub fn decode(bytes: &[u8]) -> Result<Self, DebugMetaError>
pub fn decode(bytes: &[u8]) -> Result<Self, DebugMetaError>
Decode a pool from its canonical byte form. The returned pool’s
records are in the canonical order encode
emits, so decode(encode(p)) round-trips and re-encodes to the
identical bytes.
Sourcepub fn records_at(&self, op_index: u32) -> impl Iterator<Item = &DebugRecord>
pub fn records_at(&self, op_index: u32) -> impl Iterator<Item = &DebugRecord>
The records annotating op-stream position op_index, in
canonical order. Empty when the position carries no debug
information.
Sourcepub fn string(&self, index: u16) -> Option<&str>
pub fn string(&self, index: u16) -> Option<&str>
The string-pool entry at index, or None when out of range.
Sourcepub fn span(&self, index: u16) -> Option<Span>
pub fn span(&self, index: u16) -> Option<Span>
The span-pool entry at index, or None when out of range.
Sourcepub fn type_blob(&self, index: u16) -> Option<&[u8]>
pub fn type_blob(&self, index: u16) -> Option<&[u8]>
The type sub-pool blob at index, or None when out of range.
A TypeAnnotation record’s second operand indexes this pool.
The blob is the opaque TypeRepr; the current compiler stores a
UTF-8 string-form rendering.
Sourcepub fn source_location(
&self,
record: &DebugRecord,
) -> Option<SourceLocation<'_>>
pub fn source_location( &self, record: &DebugRecord, ) -> Option<SourceLocation<'_>>
Resolve a record that references a span to a SourceLocation.
Applies to record kinds whose first operand indexes the span
pool (CallSite, SourceSpan, AssertionContext,
BreakpointCandidate). Returns None for other kinds, for a
record with no operands, or when an operand index dangles.
Trait Implementations§
impl Eq for DebugPool
impl StructuralPartialEq for DebugPool
Auto Trait Implementations§
impl Freeze for DebugPool
impl RefUnwindSafe for DebugPool
impl Send for DebugPool
impl Sync for DebugPool
impl Unpin for DebugPool
impl UnsafeUnpin for DebugPool
impl UnwindSafe for DebugPool
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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.