Struct rustc_metadata::index::Index [] [src]

pub struct Index {
    // some fields omitted
}
Unstable (rustc_private)

As part of the metadata, we generate an index that stores, for each DefIndex, the position of the corresponding RBML document (if any). This is just a big [u32] slice, where an entry of u32::MAX indicates that there is no RBML document. This little struct just stores the offsets within the metadata of the start and end of this slice. These are actually part of an RBML document, but for looking things up in the metadata, we just discard the RBML positioning and jump directly to the data.

Methods

impl Index
[src]

fn from_rbml(index: Doc) -> Index

Unstable (rustc_private)

Given the RBML doc representing the index, save the offests for later.

fn lookup_item(&self, bytes: &[u8], def_index: DefIndex) -> Option<u32>

Unstable (rustc_private)

Given the metadata, extract out the offset of a particular DefIndex (if any).